SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/03/2018, 04:09 PM   #1
Zeus666
Huge Clucker
 
Join Date: Mar 2015
Posts: 460
Reputation: 42
Default setting if to command

PHP Code:
        case 5:
        {
            if((
CP[playerid] > 0) && (MilitarJob[playerid] == 5)) return SendClientMessage(playerid, -1"Mission Failed, your CP is 1 !");
            {
                
DisablePlayerCheckpoint(playerid);
                
SendClientMessage(playerid, -1"You accomplished your mission!!");
                
GivePlayerMoney(playerid,2500);
                
MilitarJob[playerid] = 0;
                
CP[playerid] = 0;
            }
        } 

How can I make
PHP Code:
if pInfo[playerid][ZombiesKilled] > 1  GivePlayerMoney(playerid,5000);
if 
pInfo[playerid][ZombiesKilled] < 0 GivePlayerMoney(playerid,2500); 
Zeus666 is offline   Reply With Quote
Old 21/03/2018, 04:18 PM   #2
m4karow
Big Clucker
 
Join Date: Oct 2015
Posts: 137
Reputation: 13
Default Re: setting if to command

make what?
m4karow is offline   Reply With Quote
Old 21/03/2018, 04:19 PM   #3
Zeus666
Huge Clucker
 
Join Date: Mar 2015
Posts: 460
Reputation: 42
Default Re: setting if to command

Quote:
Originally Posted by m4karow View Post
make what?
PHP Code:
if pInfo[playerid][ZombiesKilled] > 1  GivePlayerMoney(playerid,5000); 
if 
pInfo[playerid][ZombiesKilled] < 0 GivePlayerMoney(playerid,2500); 


if player has ZombiesKilled more than 1 to give him 5000$
if players has zero zombieskilled give him 2500$
Zeus666 is offline   Reply With Quote
Old 21/03/2018, 05:00 PM   #4
kovac
Banned
 
Join Date: Mar 2018
Posts: 182
Reputation: 14
Default Re: setting if to command

PHP Code:
if(pInfo[playerid][ZombiesKilled] > 1)
{
    
GivePlayerMoney(playerid,5000);
}
if(
pInfo[playerid][ZombiesKilled] == 0)
{
    
GivePlayerMoney(playerid,2500);

kovac is offline   Reply With Quote
Old 21/03/2018, 05:03 PM   #5
Zeus666
Huge Clucker
 
Join Date: Mar 2015
Posts: 460
Reputation: 42
Default Re: setting if to command

Quote:
Originally Posted by kovac View Post
PHP Code:
if(pInfo[playerid][ZombiesKilled] > 1)
{
    
GivePlayerMoney(playerid,5000);
}
if(
pInfo[playerid][ZombiesKilled] == 0)
{
    
GivePlayerMoney(playerid,2500);



PHP Code:
        case 5:
        {
            if(
MilitarJob[playerid] != 5) return SendClientMessage(playerid, -1"Mission Failed. Go back to base.");
            {
            if(
pInfo[playerid][ZombiesKilled] == 0)
{
GivePlayerMoney(playerid,2500);
            }
}
if(
pInfo[playerid][ZombiesKilled] > 1)
{
GivePlayerMoney(playerid,5000);
}
        } 
??
Zeus666 is offline   Reply With Quote
Old 21/03/2018, 05:06 PM   #6
kovac
Banned
 
Join Date: Mar 2018
Posts: 182
Reputation: 14
Default Re: setting if to command

Quote:
Originally Posted by Zeus666 View Post
PHP Code:
        case 5:
        {
            if(
MilitarJob[playerid] != 5) return SendClientMessage(playerid, -1"Mission Failed. Go back to base.");
            {
            if(
pInfo[playerid][ZombiesKilled] == 0)
{
GivePlayerMoney(playerid,2500);
            }
}
if(
pInfo[playerid][ZombiesKilled] > 1)
{
GivePlayerMoney(playerid,5000);
}
        } 
??
PHP Code:
case 5:
{
    if(
MilitarJob[playerid] != 5) return SendClientMessage(playerid, -1"Mission Failed. Go back to base.");
    {
         if(
pInfo[playerid][ZombiesKilled] > 1)
        {
            
GivePlayerMoney(playerid,5000);
           }
        else if(
pInfo[playerid][ZombiesKilled] == 0)
        {
            
GivePlayerMoney(playerid,2500);
        }
    }

kovac is offline   Reply With Quote
Old 21/03/2018, 05:44 PM   #7
Maximun
Gangsta
 
Join Date: Jan 2014
Location: Localhost
Posts: 720
Reputation: 52
Default Re: setting if to command

Can you try that ? Let me know if didn't worked.

PHP Code:
        case 5
        { 
            if((
CP[playerid] > 0) && (MilitarJob[playerid] == 5)) return SendClientMessage(playerid, -1"Mission Failed, your CP is 1 !"); 
            { 
                if(
pInfo[playerid][ZombiesKilled] > 1)
                    
GivePlayerMoney(playerid5000);
                else if(
pInfo[playerid][ZombiesKilled] == 0)
                    
GivePlayerMoney(playerid2500);
                
DisablePlayerCheckpoint(playerid); 
                
SendClientMessage(playerid, -1"You accomplished your mission!!"); 
                
//GivePlayerMoney(playerid,2500); 
                
MilitarJob[playerid] = 0
                
CP[playerid] = 0
            } 
        } 
Maximun is offline   Reply With Quote
Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting timer in command eikzdej Scripting Help 3 03/02/2016 06:56 AM
Setting skin after use of command LeXuZ Scripting Help 10 05/03/2015 08:51 PM
[Help] Setting Command With Key Arxalan Scripting Help 2 30/12/2014 03:47 AM
VIP command... Setting it for a certain date Geniuss Scripting Help 5 09/06/2012 07:23 PM
Setting a command to a certain Player? Swizzzy Scripting Help 7 13/09/2011 11:41 PM


All times are GMT. The time now is 11:19 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.