Code:
case 6: // anti frost
{
if( !is_user_alive( id ) )
{
return PLUGIN_HANDLED;
}
if(userantifrost[id] > 0)
{
return PLUGIN_HANDLED;
}
new money = cs_get_user_money( id )
new cost = get_pcvar_num( antifrost )
if ( money >= cost )
{
cs_set_user_money( id, money - cost )
add_user_immune(id)
userantifrost[id]++;
}
else
{
client_print_color( id, Green, "[Shop] You need more money to buy this item!" ); }
Okay so as of now judging by the looks of it, I have the anti frost working when bought, adds the immune which are natives which are put at the top of the code.
My problem is that I want to reset it on death and round end to remove_user_immune(id)
Any help would be highly appreciated!
Thanks!
EDIT:
Code:
if(userantifrost[id] > 0)
{
return PLUGIN_HANDLED;
}
If I added the remove_user_immunity(id); before the return PLUGIN_HANDLED; would that do the trick?
EDIT 2: NVM just realized how stupid that sounds ^
Code:
public client_connect( id )
{
userantifrost[id] =0;
}
public client_disconnect( id )
{
userantifrost[id] =0;
}
public eDeath( id )
{
new victim = read_data(2);
userantifrost[victim] =0;
}
__________________