Quote:
Originally Posted by blade81
If i make it explained as down then I get only id's from player instead valvues of them.
Is something missing in this code?
Code:
player_spawn.cfg
es_setinfo vartext 0
es_setinfo varname 0
es_format varname "hitcount_%1" event_var(userid)
es alias expand es_setinfo "server_var(varname)" 0
es expand
Code:
player_hurt.cfg
es_format varname "hitcount_%1" event_var(attacker)
es es_math server_var(varname) + 1
Code:
player_death.cfg
es_format vartext "hitstotal_%1" server_var(varname)
es es_msg server_var(vartext)
|
If you wanted to see what was in "hitstotal_1", for example, the player_death.cfg needs to be adjusted. The last line is just telling you to look-up the name of the variable stored in "vartext". That'll just be the literal name "hitstotal_1", for example. You need to look 'inside' that variable another level.
For example, this should work:
Code:
// player_death.cfg
es_format vartext "hitstotal_%1" server_var(varname)
setinfo varvalue 0
es_copy varvalue server_var(vartext)
es es_msg server_var(varvalue)
This causes us to es_copy the value from the variable name "server_var(vartext)" to the variable name "varvalue". In the other scripts above you didn't to es_copy it into another variable because es_math and the like uses variable names. es_msg assumes anything you pass it is a literal string, so you need to dig deeper to get the information.
Does this make sense? Hope this helps,
-Mattie