16.06.2016, 19:32
Guys i have problem here. This is my cmd:robbank
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.
PHP Code:
new robpossible;
new robtraje;
YCMD:opljackaj(playerid, params[], help)
{
#pragma unused help
if(robpossible == 1)
{
if(PlayerInfo[playerid][pClan] == 2|| PlayerInfo[playerid][pLider] == 2 || PlayerInfo[playerid][pClan] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pClan] == 4 || PlayerInfo[playerid][pLider] == 4 || PlayerInfo[playerid][pClan] == 5 || PlayerInfo[playerid][pLider] == 5)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1467.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", 300000, false);
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", 600000, false);
SCM(playerid,-1,"ES:RPG | "CRVENA"Posto nemate alat za pljacku morate ostati na mjestu 10 minuta!");
}
SetPlayerWantedLevel(playerid, 6);
SetTimer("waittimer", 2400000, false);
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], pljackas, cash = random(200000);
GivePlayerMoney(pljackas, cash);
robtraje = 0;
SCMTA(0xFF9900AA, "||----------Vanredne Vijesti----------||");
format(string, sizeof(string), "Pljackas je uspio iznijeti %d$ iz banke!", cash);
SCMTA(-1, string);
SCMTA(0xFF9900AA, "||----------Vanredne Vijesti----------||");
}
///////////////////////////////////////////////////////////////////////////
forward waittimer();
public waittimer()
{
new string[128];
robpossible = 1;
format(string, sizeof(string), CRVENA"Banka se opet moze pljackati!");
BandeMafije(-1, string);
}
///////////////////////////////////////////////////////////////////////////
I have no idea how to make this.