Raised This Month: $ Target: $400
 0% 

[solved] clear function's global variable


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-14-2009 , 09:56   Re: clear function's global variable
Reply With Quote #6

PHP Code:
#include <amxmodx>

new g_Test;

public 
plugin_init( )
{
    
register_plugin"Bleh""Blah""Bluh" );
    
    
register_clcmd"say /test""test" );
}

public 
test( )
{
    
g_Test random_num1100 );
    
    
client_print0print_chat"g_Test was randomized: %d"g_Test );
    
    
resetg_Test );
    
    
client_print0print_chat"Cleared. g_Test is now: %d"g_Test );
}

reset( &iVar )
    
iVar 0

Following output:

Code:
g_Test was randomized: 34
Cleared. g_Test is now: 0
Nextra :  /test
Resetting globals byref is possible.
__________________
In Flames we trust!
Nextra 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 02:24.


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