Raised This Month: $ Target: $400
 0% 

Stop a function on round end


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-11-2009 , 11:08   Re: Stop a function on round end
Reply With Quote #2

a global variable, hook round end event set the varible true, hook round start to set it back to false and add a check for that variable in the function

what I just said in code terms:
PHP Code:
#include <amxmodx>
 
new bool:g_bRoundEnded false
 
public plugin_init()
{
    
register_logevent("event_roundStart"2"1=Round_Start")
    
register_logevent("event_roundEnd"2"1=Round_End")
}
 
public 
event_roundEnd() g_bRoundEnded true
public event_roundStart() g_bRoundEnded false
 
public your_function()
{
    if(
g_bRoundEnded)
        return 
PLUGIN_CONTINUE
 
    
// code here, will be executed if round is still playing
 
    
return PLUGIN_CONTINUE

__________________
Hunter-Digital 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 01:37.


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