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:
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.Code:#define stringvalue (dvarstring( mc_tokens ) == <return_certain_string_value>) statSetOnDvarStringValue( mc_tokens, stringvalue, 3175, 1 );
2. If you are trying to set a stat when the dvar is an integer value:
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().Code:#define dvarvalue (dvarbool( mc_tokens ) == <return_certain_int_value>) statsetusingtable( 3175, dvarvalue );



Reply With Quote