so i haveproblem... when player change nick from nonvip name to vip player name, then all works fine, but when player changes Vip name to nonvip name he stays vip extras. Wher can be problem in script?
Main function:
Code:
public client_infochanged(id)
{
hashevip(id)
if(isvip[id])
{
givevip(id)
console_print(id,"You are VIP")
}
else
{
takevip(id)
console_print(id,"You arent VIP")
}
return PLUGIN_CONTINUE
}
hashevip function:
Code:
public hashevip(id)
{
new newname[32]
..........
if( equal(mysql_name, newname))
{
isvip[id] = true
}
.............
}
givevip function:
Code:
public givevip(id)
{
new armor
armor = str_to_num("100")
set_user_armor(id, armor)
}
takevip function:
Code:
public takevip(id)
{
new armor
armor = str_to_num("0")
set_user_armor(id, armor)
}