CMD:robbank(playerid, params[])
{
if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
if(IsRobbingBank1{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
if(IsRobbingBank2{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
if(IsRobbingBank3{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
if(IsRobbingBank4{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
if(alreadyrob == 1){ }else return SendClientMessage(playerid, RED, "This Bank Has Been Robbed Recently. Please Wait Before Robbing It Again.");
if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
if((gettime() - 5) < TimerInfo[playerid][CMD_timer23]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
TimerInfo[playerid][CMD_timer23] = gettime();
if(IsPlayerInRangeOfPoint(playerid,1.0,2316.6169,-7.3947,26.7422) && GetPlayerVirtualWorld(playerid) == 1)
{
new chance = random(3);
if(chance == 0)
{
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
format(fstr, sizeof(fstr), "%s (%d) has attempted to rob the Bank at Roco Escalante (LV).", GetName(playerid), playerid);
CopRadio(BLUE, fstr);
SendClientMessage(playerid, RED, "You have failed to rob the Bank.");
GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
}
else
{
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
if((gettime() - 5) < bank1robbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
format(fstr, sizeof(fstr), "%s (%d) is now robbing the Bank at Roco Escalante (LV).", GetName(playerid), playerid);
CopRadio(BLUE, fstr);
format(fstr, sizeof(fstr), "Committed A Crime: Post Bank Robbery - Wanted Level %d - Arrestable", WantedLevelStars);
SendClientMessage(playerid, LIGHTGREEN, "You're Robbing the Bank, DON'T LEAVE THE CHECKPOINT!");
IsRobbingBank1{playerid} = true;
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
bank1robbed = gettime();
banktimer{playerid} = SetTimerEx("BankRob", 30000, false, "d", playerid);
CountDownRobbery(playerid, 30);
alreadyrob = 0;
SetTimer("togglerob", 300000, false);
}
}
else if(IsPlayerInRangeOfPoint(playerid,1.0,2316.6169,-7.3947,26.7422) && GetPlayerVirtualWorld(playerid) == 2)
{
new chance = random(3);
if(chance == 0)
{
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
format(fstr, sizeof(fstr), "%s (%d) has attempted to rob the Bank at El Quebrados.", GetName(playerid), playerid);
CopRadio(BLUE, fstr);
SendClientMessage(playerid, RED, "You have failed to rob the Bank.");
GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
}
else
{
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
if((gettime() - 5) < bank2robbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
format(fstr, sizeof(fstr), "%s (%d) is now robbing the Bank at El Quebrados.", GetName(playerid), playerid);
CopRadio(BLUE, fstr);
format(fstr, sizeof(fstr), "Committed A Crime: Post Bank Robbery - Wanted Level %d - Arrestable", WantedLevelStars);
SendClientMessage(playerid, LIGHTGREEN, "You're Robbing the Bank, DON'T LEAVE THE CHECKPOINT!");
IsRobbingBank2{playerid} = true;
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
bank2robbed = gettime();
banktimer{playerid} = SetTimerEx("BankRob", 30000, false, "d", playerid);
CountDownRobbery(playerid, 30);
alreadyrob = 0;
SetTimer("togglerob", 300000, false);
}
}
else if(IsPlayerInRangeOfPoint(playerid,1.0,2316.6169,-7.3947,26.7422) && GetPlayerVirtualWorld(playerid) == 3)
{
new chance = random(3);
if(chance == 0)
{
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
format(fstr, sizeof(fstr), "%s (%d) has attempted to rob the Bank at Fort Carson.", GetName(playerid), playerid);
CopRadio(BLUE, fstr);
SendClientMessage(playerid, RED, "You have failed to rob the Bank.");
GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
}
else
{
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
if((gettime() - 5) < bank3robbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
format(fstr, sizeof(fstr), "%s (%d) is now robbing the Bank at Fort Carson.", GetName(playerid), playerid);
CopRadio(BLUE, fstr);
format(fstr, sizeof(fstr), "Committed A Crime: Post Bank Robbery - Wanted Level %d - Arrestable", WantedLevelStars);
SendClientMessage(playerid, LIGHTGREEN, "You're Robbing the Bank, DON'T LEAVE THE CHECKPOINT!");
IsRobbingBank3{playerid} = true;
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
bank3robbed = gettime();
banktimer{playerid} = SetTimerEx("BankRob", 30000, false, "d", playerid);
CountDownRobbery(playerid, 30);
alreadyrob = 0;
SetTimer("togglerob", 300000, false);
}
}
else if(IsPlayerInRangeOfPoint(playerid,1.0,2316.6169,-7.3947,26.7422) && GetPlayerVirtualWorld(playerid) == 4)
{
new chance = random(3);
if(chance == 0)
{
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
format(fstr, sizeof(fstr), "%s (%d) has attempted to rob the Bank at Tierra Robada.", GetName(playerid), playerid);
CopRadio(BLUE, fstr);
SendClientMessage(playerid, RED, "You have failed to rob the Bank.");
GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
}
else
{
if(GetPlayerWantedLevel(playerid) >= 4) return SendClientMessage(playerid, RED, "You Have A Wanted Level For Your Arrest. You Can Not Rob A Bank.");
if((gettime() - 5) < bank4robbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
format(fstr, sizeof(fstr), "%s (%d) is now robbing the Bank at Tierra Robada.", GetName(playerid), playerid);
CopRadio(BLUE, fstr);
format(fstr, sizeof(fstr), "Committed A Crime: Post Bank Robbery - Wanted Level %d - Arrestable", WantedLevelStars);
SendClientMessage(playerid, LIGHTGREEN, "You're Robbing the Bank, DON'T LEAVE THE CHECKPOINT!");
IsRobbingBank4{playerid} = true;
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
bank4robbed = gettime();
banktimer{playerid} = SetTimerEx("BankRob", 30000, false, "d", playerid);
CountDownRobbery(playerid, 30);
alreadyrob = 0;
SetTimer("togglerob", 300000, false);
}
}
else
{
SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
}
new astring[100],pName[24];
GetPlayerName(playerid,(pName),sizeof(pName));
format(astring,sizeof(astring),"%s (%d) typed: /robbank",pName,playerid);
SendAdmin1Message(GREY,astring);
return true;
}
alreadyrob = 0;
SetTimer("togglerob", 300000, false);
if(alreadyrob == 1){ }else return SendClientMessage(playerid, RED, "This Bank Has Been Robbed Recently. Please Wait Before Robbing It Again.");
if(alreadyrob != 1) return SendClientMessage(playerid, RED, "This Bank Has Been Robbed Recently. Please Wait Before Robbing It Again.");
Show your togglerob function.
pawn Код:
pawn Код:
|