Raised This Month: $ Target: $400
 0% 

[HELP] Anti-Frost question


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
malec321
Senior Member
Join Date: May 2009
Location: Los Angeles
Old 09-10-2012 , 21:01   [HELP] Anti-Frost question
Reply With Quote #1

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;
}
__________________
Ayyylmao

Last edited by malec321; 09-10-2012 at 21:06.
malec321 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode