CMD:robstore(playerid,params[]) { if(!IsPlayerInCheckpoint(playerid)) { SendClientMessage(playerid, COLOR_ERROR, "You are not in the checkpoint!"); return 1; } if(gTeam[playerid] == POLICE || gTeam[playerid] == SWAT || gTeam[playerid] == ARMY ) return SendClientMessage(playerid, COLOR_ERROR, "You cannot rob anything."); if(GetPVarInt(playerid, "RobbedRecently") > 1) return SendClientMessage(playerid, COLOR_ERROR, "You have robbed a store recently. Please wait."); new string[120]; new crand = random(100); if(checkpointid == Checkpoint[1]) { if(crand < 10) { SetPVarInt(playerid, "RobbedRecently", 65); SetGVarInt("PizzaRobbed", 60); return SendClientMessage(playerid, COLOR_ERROR, "Robbery failed."); } if(GetGVarInt("PizzaRobbed") > 1) return SendClientMessage(playerid, COLOR_ERROR, "The Well Stacked Pizza has been robbed recently."); format(string, 120, "[ROBBERY] %s has started a robbery at the Well Stacked Pizza", playerid); SendClientMessageToAll(SWAT_COLOUR, string); format(string, 120, "[DISPATCH] %s has started a robbery at the Well Stacked Pizza", playerid); SendCopMessage(string); SetPVarInt(playerid, "RobbingPizza", 15); SetPVarInt(playerid, "RobbedRecently", 120); SetGVarInt("PizzaRobbed", 120); SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+4); return 1; } return 1; }
C:\Users\****\Desktop\samp\gamemodes\boss.pwn(716) : error 017: undefined symbol "checkpointid"
CMD:robstore(playerid,params[])
{
if(!IsPlayerInCheckpoint(playerid)) {
SendClientMessage(playerid, COLOR_ERROR, "You are not in the checkpoint!");
return 1;
}
if(gTeam[playerid] == POLICE || gTeam[playerid] == SWAT || gTeam[playerid] == ARMY )
return SendClientMessage(playerid, COLOR_ERROR, "You cannot rob anything.");
if(GetPVarInt(playerid, "RobbedRecently") > 1)
return SendClientMessage(playerid, COLOR_ERROR, "You have robbed a store recently. Please wait.");
new string[120];
new crand = random(100);
if(IsPlayerInDynamicCP(playerid,Checkpoint[1]))
{
if(crand < 10)
{
SetPVarInt(playerid, "RobbedRecently", 65);
SetGVarInt("PizzaRobbed", 60);
return SendClientMessage(playerid, COLOR_ERROR, "Robbery failed.");
}
if(GetGVarInt("PizzaRobbed") > 1) return SendClientMessage(playerid, COLOR_ERROR, "The Well Stacked Pizza has been robbed recently.");
format(string, 120, "[ROBBERY] %s has started a robbery at the Well Stacked Pizza", playerid);
SendClientMessageToAll(SWAT_COLOUR, string);
format(string, 120, "[DISPATCH] %s has started a robbery at the Well Stacked Pizza", playerid);
SendCopMessage(string);
SetPVarInt(playerid, "RobbingPizza", 15);
SetPVarInt(playerid, "RobbedRecently", 120);
SetGVarInt("PizzaRobbed", 120);
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+4);
return 1;
}
return 1;
}
Try this, I think it should work for the gamemode you are using.
pawn Code:
|
public Server()
if(GetPVarInt(i, "RobbingPizza") == 1)
{
new string[120]; new pname[24]; GetPlayerName(i, pname, 24);
new rand = random(500000);
format(string, 120, "[ROBBERY] %s(%d) has robbed $%d from the Well Stacked Pizza.", pname, i, rand);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
IRC_Say(gGroupID, IRC_CHANNEL, string);
GivePlayerMoney(i, rand); IncreaseWantedLevel(i, 6); IncreaseScore(i, 3);
format(string, 120, "[DISPATCH] %s(%d) has robbed the Well Stacked Pizza. Respond now.", pname, i);
SendCopMessage(string);
format(string, 120, "Type /radiooff to turn your radio off and stop recieving alerts.");
SendCopMessage(string);
SetPVarInt(i, "RobbingPizza", 0);
}
Put this under your
pawn Code:
pawn Code:
|