Raised This Month: $ Target: $400
 0% 

[solved] clear function's global variable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-14-2009 , 12:05   Re: clear function's global variable
Reply With Quote #1

Quote:
Originally Posted by Hunter-Digital View Post
I'm using them for entitiy ID reset, so I would not need to write in every function "if is_valid_ent -> remove entity then set var to 0" instead just a function :}
that means, instead of:
Code:
if(is_valid_ent(g_iAnEnt))
        remove_entity(g_iAnEnt)
g_iAnEnt = 0
on every function that I need to do that... I could just:
Code:
clear(g_iAnEnt)
clear(g_iAnotherEnt)
clear(g_iAndAnotherEnt)
 
//...
 
stock clearEnt(&ent)
{
        if(is_valid_ent(ent))
                remove_entity(ent)
        ent = 0
}
This is solved, thank you guys
__________________
Hunter-Digital is offline
Reply



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 02:24.


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