SA-MP Forums Archive
setting if to command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: setting if to command (/showthread.php?tid=651512)



setting if to command - Zeus666 - 21.03.2018

PHP код:
        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 код:
if pInfo[playerid][ZombiesKilled] > 1  GivePlayerMoney(playerid,5000);
if 
pInfo[playerid][ZombiesKilled] < 0 GivePlayerMoney(playerid,2500); 



Re: setting if to command - m4karow - 21.03.2018

make what?


Re: setting if to command - Zeus666 - 21.03.2018

Quote:
Originally Posted by m4karow
Посмотреть сообщение
make what?
PHP код:
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$


Re: setting if to command - kovac - 21.03.2018

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




Re: setting if to command - Zeus666 - 21.03.2018

Quote:
Originally Posted by kovac
Посмотреть сообщение
PHP код:
if(pInfo[playerid][ZombiesKilled] > 1)
{
    
GivePlayerMoney(playerid,5000);
}
if(
pInfo[playerid][ZombiesKilled] == 0)
{
    
GivePlayerMoney(playerid,2500);


PHP код:
        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);
}
        } 
??


Re: setting if to command - kovac - 21.03.2018

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
PHP код:
        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 код:
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);
        }
    }




Re: setting if to command - Maximun - 21.03.2018

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

PHP код:
        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
            } 
        }