Hello, me again, I found that PLUGIN_CONTINUE allows further command execution and PLUGIN_HANDLED halts it. what i'm trying to do here is when player touch the shield(i want to try using shield as example for myself because after reading a few topics, I found out that shield is not registered as other items/weapons so it's more difficult), find if the player can touch it, if can,then allow pickup if no, don't let it pickup. however, no matter if player has rights to pick up shield or no, walking over shield does nothing as if player didn't have rights(with the excerpt of code i posted bellow) i tried moving things around but nothing works. if i remove all PLUGIN_HANDLED
's ,it lets pickup shield. it also doesn't print any of the messages i wrote to check if it's executed correctly. i also tried
0 instead of
id in client_print thinking that id is not passed, but doesn't work either. am i using wrong method?
PHP Code:
<...>
#include <engine>
<...>
register_touch("weapon_shield", "player", "on_shield_touch")
<...>
public on_shield_touch(id){
if((get_user_flags(id) & VIP_FLAG) && vip_values_hp_or_money[id] == 7){
client_print(id, print_center, "vip, value, working")
return PLUGIN_CONTINUE
}
if(get_user_flags(id) & VIP_FLAG){
if(vip_values_hp_or_money[id] != 7){
client_print(id, print_chat, "vip, wrong value, working")
return PLUGIN_HANDLED
}
}
else if(!(get_user_flags(id) & VIP_FLAG)){
client_print(id, print_center, "not vip, working")
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE // removing this doesnt let pick shield at all ,with no messages. and as i understand i shouldn't delete it anyways
}
thank you