I tooked code from this plugin to test something:
http://forums.alliedmods.net/showthread.php?p=1038382
And now when I want to send money it doesn`t work:
PHP Code:
money(id, say[]) {
new amount = str_to_num(say)
new victim = gidPlayer[id]
ColorChat(id, TEAM_COLOR,"[^4BCG^3] Test")
if( victim > 0 ) {
ColorChat(id, TEAM_COLOR,"[^4BCG^3] Test2")
new name[32], vname[32]
new idMoney = cs_get_user_money(id)
get_user_name(id, name, charsmax(name))
get_user_name(victim, vname, 31)
if(amount > idMoney)
{
ColorChat(id, TEAM_COLOR,"[^4BCG^3] Tes3")
ColorChat(id, TEAM_COLOR,"[^4BCG^3] Nemas dovoljno para!")
client_cmd(id, "messagemode playermoney")
return PLUGIN_HANDLED
}
else {
ColorChat(id, TEAM_COLOR,"[^4BCG^3] Test5")
cs_set_user_money(id, cs_get_user_money(id) - amount)
cs_set_user_money(victim, cs_get_user_money(victim) + amount)
ColorChat(id, TEAM_COLOR,"[^4BCG^3] Poslao si mu %d$ ((%s))",amount, vname)
ColorChat(victim, TEAM_COLOR,"[^4BCG^3] %s ti je poslao %d$",name, amount)
}
openmenu[id] = false
}
else {
ColorChat(id, TEAM_COLOR,"[^4BCG^3] Test6")
return PLUGIN_HANDLED
}
ColorChat(id, TEAM_COLOR,"[^4BCG^3] Test10")
return PLUGIN_HANDLED
}
Note: I added these few prints so I can know where`s to problem and probles is with "if( victim > 0 )". Plugins skips that part like victim isn`t > 0. Vistims is victims's id...