Raised This Month: $ Target: $400
 0% 

how to stop a function?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 04-09-2009 , 08:45   how to stop a function?
Reply With Quote #1

edit: thx, i made an addition check not to allow 2nd execution of function in short-time, should work now i hope



PHP Code:
public plugin_init() {
register_clcmd("say""function");
}

public function(
id)
{
    new 
said[192]
    new 
ij
    
new cheatername[32]
    
get_user_name(idcheatername32)
    
read_args(said192)
    
    for(
sizeof (CheatReports) ; i++)
    {
         if(
containi(saidCheatReports[i][j]) != -1)
        {
            
set_task(3.3,"nodb");
            if(
cheater_1 == 0)
            {
                
action1(id)
                return 
PLUGIN_HANDLED
            
}
        }

    }
    
    for(
sizeof (CheatReports2) ; i++)
    {
        if(
containi(saidCheatReports2[i][j]) != -1)
        {
            
set_task(3.3,"nodc");
            if(
cheater_2 == 0)
            {
                
action2(id)
                return 
PLUGIN_HANDLED
            
}
        }
    }
    
    return 
PLUGIN_CONTINUE
    

hi, i want to stop function() when action1() is executed and not to let action2() to execute, i thought return PLUGIN_HANDLED should do that but it doesn't, action2() is still executed after action1() if they both met conditions
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 04-09-2009 at 10:35.
Owyn is offline
Send a message via ICQ to Owyn
 



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:18.


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