Raised This Month: $ Target: $400
 0% 

Question about return


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 01-23-2016 , 17:22   Question about return
Reply With Quote #1

First, let's post the code...
PHP Code:
public PlayerKilled(victimattacker);
{
    
gIsFreeday[id] = false// line 3
    
gHasCrowbar[id] = false// line 4
    
    
CheckSimon(victim); // line 6
    
RewardEur(victimattacker); // line 7
}

public 
CheckSimon(id)
{
    if(!
gIsSimon[id])
        return 
PLUGIN_CONTINUE// line 13

    
gIsSimon[id] = false// line 15
    
gSimon 0;
    
ColorChat(0GREEN"[Jail] Simon je ubijen, neko bi trebao da ga zameni");

Now that's an example (I'm not gonna post it, It's for me only, don't worry, I know there are hundreds of jail plugins). When a player dies, in the function PlayerKilled It's supposed to set his variables to false (line 3 and 4), then call the function CheckSimon (line 6). But after doing CheckSimon, It's supposed to call RewardEur (line 7). Now. Inside the CheckSimon function. It's supposed to check if the user is simon. If not then It halts the function. If I use PLUGIN_HANDLED instead of PLUGIN_CONTINUE on line 13, will it also halt the previous function where CheckSimon was called? And does PLUGIN_CONTINUE actually halt this function but continues with CheckSimon?
I'm a bit confused so if you can't understand me go ahead.

Last edited by redivcram; 01-23-2016 at 17:23.
redivcram is offline
 


Thread Tools
Display Modes

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 09:26.


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