Quote Originally Posted by Tally View Post
Those values don't match: you are getting a stat for dvarInt( mc_tokens) + 3175; but you are trying to set the stat number 3175 when a dvar (mc_tokens) has a string value. In other words - mc_tokens is both a stat number and a string. Hence why it wont work. So, it looks to me like you are confused about what mc_tokens is - an integer or a string. So, here are 2 possible solutions:

1. If you are trying to set a stat when a certain dvarstring matches a certain string value, you need only put in the string value for mc_tokens:

Code:
	#define stringvalue (dvarstring( mc_tokens ) == <return_certain_string_value>)
	statSetOnDvarStringValue( mc_tokens, stringvalue, 3175, 1 );
statSetOnDvarStringValue is in 4 parts; 1 = the dvarstring; 2 = the string value when to set the stat number; 3 = the stat number to set; 4 = the amount to set the stat number to.

2. If you are trying to set a stat when the dvar is an integer value:

Code:
	#define dvarvalue (dvarbool( mc_tokens ) == <return_certain_int_value>)
	statsetusingtable( 3175, dvarvalue );
statsetusingtable is in 2 parts: 1 = the stat number to set; 2 = the stat value to set. It is the UI engine's version of setStat(). The reason it has "table" in its name is because you can get the stat value to set to from a table by using tableLookup().
Thank you i got it to work in the end i was also wondering if it was possible to save custom dvars to either the savegame.svg or add them to your profile (gamerprofile_updategamerprofileFromDvars, updategamerprofile for short) so that they can load the dvars once and retrieve the correct values?

also is it somehow possible (for coop zombies) to have some sort of way to update a dvar from a external hosted server? (e.g. a hosting website) just like the server.cfg files for cod4, but for zombies?

Thank you for everything btw, it means a lot