| anakin_cstrike |
09-04-2008 19:26 |
nVault Problem
Hi..i have this code, but it doesn't work.
PHP Code:
public client_disconnect(id) { static Key[64],Value[64],name[32], stats[8],body[8],stats2[4], rank_pos,Vault; rank_pos = get_user_stats(id,stats,body) get_user_stats2(id,stats2); total[id] = stats2[1] + stats2[2] + stats2[3] + stats[0] - stats[1]; Vault = nvault_open("war_points"); get_user_name(id,name, sizeof name - 1); formatex(Key, sizeof Key - 1, "%s-War_Points-%d",name,rank_pos); formatex(Value,sizeof Value - 1, "%d", total[id]); nvault_set(Vault, Key, Value); nvault_close(Vault); } public client_putinserver(id) { static Key[64], Value[64], name[32],Vault; get_user_name(id,name, sizeof name - 1); Vault = nvault_open("war_points"); formatex(Key, sizeof Key - 1, "%s-War_Points:",name); nvault_get(Vault, Key, Value, sizeof Value - 1); nvault_close(Vault); Number[id] = str_to_num(Value); set_task(5.0,"changewithpoints",id); } public changewithpoints(id) { if(!is_user_connected(id)) return PLUGIN_CONTINUE; new name[32],Buffer[64],value; get_user_name(id,name,31); if(Number[id] > 0) value = 100 + Number[id]; else if(Number[id] < 0) value = 100 - Number[id]; switch(get_user_team(id)) { case 1: formatex(Buffer,63,"b.%s<%d>",name,value); case 2: formatex(Buffer,63,"a.%s<%d>",name,value); } client_cmd(id,"name ^"%s^"",Buffer); return PLUGIN_CONTINUE; }
I want to change the name like this:
for example...
* 100 - default number
* 150 - example number...bomb exploded,+defused,+planted + kills - deaths
|