Need help
#1

Guys i have problem here. This is my cmd:robbank
PHP Code:
new robpossible;
new 
robtraje;
YCMD:opljackaj(playeridparams[], help)
{
    
#pragma unused help
    
if(robpossible == 1)
     {
         if(
PlayerInfo[playerid][pClan] ==  2|| PlayerInfo[playerid][pLider] == || PlayerInfo[playerid][pClan] == || PlayerInfo[playerid][pLider] == || PlayerInfo[playerid][pClan] == || PlayerInfo[playerid][pLider] == || PlayerInfo[playerid][pClan] == || PlayerInfo[playerid][pLider] == 5)
         {
             if(
IsPlayerInRangeOfPoint(playerid2.01467.7723,-1012.5716,1301.1060))
            {
                if(
GetPlayerWeapon(playerid) <= 0)
                {
                    
SCM(playerid, -1""BELA"Morate imati oruzije!");
                    return 
1;
                }
                else
                {
                    
robpossible 0;
                    
robtraje 1;
                    if(
PlayerInfo[playerid][pAlat] == 1)
                    {
                        
SetTimer("robtimer"300000false);
                        
PlayerInfo[playerid][pAlat] = 0;
                        
SCM(playerid,-1,"ES:RPG | "CRVENA"Posto imate alat za pljacku morate ostati na mjestu 5 minuta!");
                    }
                    else if(
PlayerInfo[playerid][pAlat] == 0)
                    {
                        
SetTimer("robtimer"600000false);
                        
SCM(playerid,-1,"ES:RPG | "CRVENA"Posto nemate alat za pljacku morate ostati na mjestu 10 minuta!");
                    }
                    
SetPlayerWantedLevel(playerid6);
                       
SetTimer("waittimer"2400000false);
                       
SendClientMessage(playerid, -1""SPLAVA"Pljackate banku!");
                       
SCMTA(0xFF9900AA"||----------Vanredne Vijesti----------||");
                    
SCMTA(0x33CCFFAA" U toku je pljacka banke!");
                       
SCMTA(0x33CCFFAA" Moli se policija da reaguje povodom ovoga");
                        
SCMTA(0x33CCFFAA" Savjetujemo gradjanima da ne prilaze banci");
                    
SCMTA(0xFF9900AA"||----------Vanredne Vijesti----------||");
                    return 
1;
                }
            }
        }
       }
    else
    {
        
SCM(playerid, -1""CRVENA"Ne mozete opljackati banku!");
        return 
1;
      }
       return 
1;
}
///////////////////////////////////////////////////////////////////////////
forward robtimer(playerid);
public 
robtimer(playerid)
{
    new 
string[128], pljackascash random(200000);
    
GivePlayerMoney(pljackascash);
    
robtraje 0;
    
SCMTA(0xFF9900AA"||----------Vanredne Vijesti----------||");
    
format(stringsizeof(string), "Pljackas je uspio iznijeti %d$ iz banke!"cash);
    
SCMTA(-1string);
    
SCMTA(0xFF9900AA"||----------Vanredne Vijesti----------||");
}
///////////////////////////////////////////////////////////////////////////
forward waittimer();
public 
waittimer()
{
    new 
string[128];
    
robpossible 1;
    
format(stringsizeof(string), CRVENA"Banka se opet moze pljackati!");
    
BandeMafije(-1string);
}
/////////////////////////////////////////////////////////////////////////// 
Can someone tell me how to make when player dies robbing will be stopped. When player who rob that bank dies.
I have no idea how to make this.
Reply
#2

Code:
public OnPlayerDeath(playerid)
{
     if(robtraje  == 1)
    {
     robtraje = 0;
    SendClientMessage(playerid, -1, "Your Robbery is Canceled ( Reason : You DIE )");
    }
    else
    {
        return 1;
      }
       return 1;
}
Reply
#3

thx i will try it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)