pawn Код:
dcmd_robstore(playerid,params[])
{
#pragma unused params
new string[128];
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(IsKidnapped[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command.");
return 1;
}
if(IsFrozen[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You have been frozen by a Server Administrator. You cannot use this command.");
return 1;
}
if(!IsPlayerInCheckpoint(playerid))
{
SendClientMessage(playerid,COLOR_ERROR,"You are not in the checkpoint of anywhere you can rob.");
return 1;
}
if(gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_CIA || gTeam[playerid] == TEAM_MEDIC)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot rob things with your class/skill.");
return 1;
}
if(getCheckpointType(playerid) != CP_BurgerShotMain && getCheckpointType(playerid) != CP_CluckinBellMain &&
getCheckpointType(playerid) != CP_Ammunation && getCheckpointType(playerid) != CP_GayDarMain &&
getCheckpointType(playerid) != CP_ZeroMain && getCheckpointType(playerid) != CP_MistysMain &&
getCheckpointType(playerid) != CP_GYM && getCheckpointType(playerid) != CP_School &&
getCheckpointType(playerid) != CP_WangCars && getCheckpointType(playerid) != CP_Train &&
getCheckpointType(playerid) != CP_Barbers && getCheckpointType(playerid) != CP_PizzaMain &&
getCheckpointType(playerid) != CP_ZipMain && getCheckpointType(playerid) != CP_VictimMain &&
getCheckpointType(playerid) != CP_BincoMain && getCheckpointType(playerid) != CP_CityHallMain)
{
SendClientMessage(playerid,COLOR_ERROR,"You are not in the checkpoint of anywhere you can rob.");
return 1;
}
new current_zone = player_zone[playerid];
new rrand =random(100);
if(getCheckpointType(playerid) == CP_BurgerShotMain)
{
if(zones[current_zone][zone_name] == zones[116][zone_name] || zones[current_zone][zone_name] == zones[117][zone_name])
{
if(GarciaBurgerShotRobbedRecently >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"The Garcia Burger Shot has been robbed recently.");
return 1;
}
if(rrand <= 30)
{
SendClientMessage(playerid,COLOR_ERROR,"Garcia Burger Shot robbery failed.");
GarciaBurgerShotRobbedRecently =320;
return 1;
}
GarciaBurgerShotRobbedRecently =320;
RobbingGarciaBurgerShot[playerid] =25;
RobberySetTimer[playerid] = SetTimerEx("RobberyTextDraw", 1000, true, "i", playerid);
RobberyTime[playerid] = 25;
ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",4.1,1,1,1,1,1,1);
ShowProgressBarForPlayer(playerid, bar[playerid]);
PlayerTextDrawSetString(playerid, Textdraw0, "RobberyTimeLeft");
IncreaseWantedLevel(playerid,4);
IncreasePlayerScore(playerid,1);
format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has begun to rob the Garcia Burger Shot! Get To Burger Shot and arrest the suspect.",PlayerName(playerid),playerid);
SendClientMessageToAllCops(string);
format(string,sizeof(string),"[ROBBERY] %s(%d) has begun a robbery at Burger Shot ..",PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_RED,string);
format(string,sizeof(string),"4[ROBBERY] %s(%d) has begun a robbery at Burger Shot ..",PlayerName(playerid),playerid);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}