Raised This Month: $ Target: $400
 0% 

Help for [ZP]Reward menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
eat1k
Senior Member
Join Date: Apr 2018
Old 01-22-2019 , 17:44   Re: Help for [ZP]Reward menu
Reply With Quote #6

Because you need to use else if instead of the second if because you don't need to check the same twice.

PHP Code:
new iNum 5;
new 
iFrags get_user_frags(id);

if(
iFrags == iNum)
{
    new 
current zp_get_user_exp(id);
    
zp_set_user_exp(idcurrent 3);
    
ColorChat(idTEAM_COLOR"Mission Completed!");
}
else if(
iFrags iNum)
{
    new 
current zp_get_user_exp(id);
    
zp_set_user_exp(idcurrent 3);
    
ColorChat(idTEAM_COLOR"Mission Completed!");
}
else
{
    new 
iFragsLeft iFrags iNum;
    
ColorChat(idTEAM_COLOR"Mission requierments not faced %i kills left!"iFragsLeft);

About not taking the reward more than once, check celltrie.inc and cellarray.inc.
__________________
eat1k 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 07:31.


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