Raised This Month: $ Target: $400
 0% 

return Plugin_Stop?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 09-22-2012 , 21:52   return Plugin_Stop?
Reply With Quote #1

quick question...

PHP Code:
public Action:Timer_Repeat(Handle:timerany:client)      <-------------- repeat timer
{
    
// filter
    
{
        
// filter
        
{    
            
// statement
            
CreateTimer(0.1Blaclient);      <--------------
        }
        
CreateTimer(0.2someBlaclient);      <--------------
    }
    return 
Plugin_Stop;

As u can see my code above, if i put statement "return Plugin_Stop" on the bottom, is the "CreateTimer" still will be executed or there is some other effect or consequences i should know? Dont link me to the tutorial, already read those many times but in real practice (i saw on most plugin maker) got me confused.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 09-22-2012 at 21:53.
GsiX is offline
Odecey
Junior Member
Join Date: Jul 2010
Old 09-22-2012 , 22:09   Re: return Plugin_Stop?
Reply With Quote #2

Returning Plugin_Stop will make the timer cease. In the example you gave, what the return value is is irrelevant to the execution of the CreateTimer calls.
__________________
Never confuse activity with productivity. You can be busy without a purpose, but what's the point?- Rick Warren

Last edited by Odecey; 09-22-2012 at 22:10. Reason: Grammatical error
Odecey is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 09-22-2012 , 22:10   Re: return Plugin_Stop?
Reply With Quote #3

Plugin_Stop will close the timer which is associated with the callback, the other 2 timers remain untouched.
Hope that answers your question.

Yours sincerely
Impact
__________________

Last edited by Impact123; 09-22-2012 at 22:10.
Impact123 is offline
JackieChan
AlliedModders Donor
Join Date: Nov 2009
Old 09-22-2012 , 22:12   Re: return Plugin_Stop?
Reply With Quote #4

The timers will still get created. Only "public Action:Timer_Repeat" will be effected by the "return Plugin_Stop".

*edit
Damn, I'm slow, lol.
__________________

Last edited by JackieChan; 09-22-2012 at 22:12.
JackieChan is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 09-22-2012 , 22:23   Re: return Plugin_Stop?
Reply With Quote #5

PHP Code:
TimerAny CreateTimer(1.0Timer_RepeatclientTIMER_REPEAT)    <-------------- Treminated

public Action:Timer_Repeat(Handle:timerany:client)
{
    
// filter
    
{
        
CreateTimer(0.2someBlaclient);
    }
    return 
Plugin_Stop;                                <-------------- Terminated by this

so the CreateTimer will be executed while my timer repeat (TimerAny) will be terminated.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 09-22-2012 at 22:25.
GsiX is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 09-22-2012 , 22:27   Re: return Plugin_Stop?
Reply With Quote #6

Quote:
Originally Posted by GsiX View Post
quick question...

PHP Code:
public Action:Timer_Repeat(Handle:timerany:client)      <-------------- repeat timer
{
    
// filter
    
{
        
// filter
        
{    
            
// statement
            
CreateTimer(0.1Blaclient);     // <--This will get created if filter 1 & 2 pass
        
}
        
CreateTimer(0.2someBlaclient);    //  <--This will get created if filter 1 passes
    
}
    return 
Plugin_Stop; <-- This will stop the repeating timer on the first execution
        
// If you want to keep the repeating timer running, put a 'return Plugin_Continue' up with one of those filters... 
        // then only if the 1st filter is false will this timer cease

As u can see my code above, if i put statement "return Plugin_Stop" on the bottom, is the "CreateTimer" still will be executed or there is some other effect or consequences i should know? Dont link me to the tutorial, already read those many times but in real practice (i saw on most plugin maker) got me confused.
See my comments edited in your quote
__________________
View my Plugins | Donate

Last edited by TnTSCS; 09-22-2012 at 22:27.
TnTSCS is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 09-22-2012 , 22:30   Re: return Plugin_Stop?
Reply With Quote #7

Quote:
Originally Posted by TnTSCS View Post
See my comments edited in your quote
Thanks... that was awesome explanation.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX 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 21:17.


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