04.08.2012, 16:31
Okay, with my other menus it says 1. Buy Dildo
And 2. Rob Store
When you press 2 it wont show up in chat if you are at the checkpoint.
Except for my ammunation one.
How do I fix this?
And 2. Rob Store
When you press 2 it wont show up in chat if you are at the checkpoint.
Except for my ammunation one.
pawn Код:
if(text[0] == '2' && AMMUBOX[playerid] == 1)
{
if(CPS_IsPlayerInCheckpoint(playerid, cpammu))
{
AMMUBOX[playerid] = 0;
if(gTeam[playerid] != COP && gTeam[playerid] != Medic && gTeam[playerid] != SWAT && gTeam[playerid] != FBI && gTeam[playerid] != ARMY)
{
if(AmmuRecentlyRobbed == 0)
{
new chances = random(500);
if(chances >= 0 && chances <= 400)
{
new string[250];
RobAmmu[playerid] = 20;
AmmuRecentlyRobbed = 150;
format(string, sizeof(string), "%s[ID:%d] started a robbery at Ammunation!", name, playerid);
Announce(string);
return true;
}
else if(chances >= 401 && chances <= 500)
{
new copmsg[250];
SendClientMessage(playerid, ERROR, "Your attempt to rob Ammunation failed!");
SendClientMessage(playerid, ERROR, "The Police are on their way to the store.");
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+ 5);
format(copmsg, sizeof(copmsg), "[HQ] %s attemped to rob Ammunation.", name);
SendRadioMessageToCops(copmsg);
AmmuRecentlyRobbed = 100;
return true;
}
}
else if(AmmuRecentlyRobbed > 0) return SendClientMessage(playerid, ERROR, "Ammunation has been robbed recently!");
}
else SendClientMessage(playerid, ERROR, "Your team cannot rob anything.");
}
if(CPS_IsPlayerInCheckpoint(playerid, cpammu2))
{
AMMUBOX[playerid] = 0;
if(gTeam[playerid] != COP && gTeam[playerid] != Medic && gTeam[playerid] != SWAT && gTeam[playerid] != FBI && gTeam[playerid] != ARMY)
{
if(Ammu2RecentlyRobbed == 0)
{
new chances = random(500);
if(chances >= 0 && chances <= 400)
{
new string[250];
RobAmmu2[playerid] = 20;
Ammu2RecentlyRobbed = 150;
format(string, sizeof(string), "%s[ID:%d] started a robbery at Ammunation!", name, playerid);
Announce(string);
return true;
}
else if(chances >= 401 && chances <= 500)
{
new copmsg[250];
SendClientMessage(playerid, ERROR, "Your attempt to rob Ammunation failed!");
SendClientMessage(playerid, ERROR, "The Police are on their way to the store.");
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+ 5);
format(copmsg, sizeof(copmsg), "[HQ] %s attemped to rob Ammunation.", name);
SendRadioMessageToCops(copmsg);
Ammu2RecentlyRobbed = 100;
return true;
}
}
else if(Ammu2RecentlyRobbed > 0) return SendClientMessage(playerid, ERROR, "Ammunation has been robbed recently!");
}
else SendClientMessage(playerid, ERROR, "Your team cannot rob anything.");
}
if(CPS_IsPlayerInCheckpoint(playerid, cpammu3))
{
AMMUBOX[playerid] = 0;
if(gTeam[playerid] != COP && gTeam[playerid] != Medic && gTeam[playerid] != SWAT && gTeam[playerid] != FBI && gTeam[playerid] != ARMY)
{
if(Ammu3RecentlyRobbed == 0)
{
new chances = random(500);
if(chances >= 0 && chances <= 400)
{
new string[250];
RobAmmu3[playerid] = 20;
Ammu3RecentlyRobbed = 150;
format(string, sizeof(string), "%s[ID:%d] started a robbery at Ammunation!", name, playerid);
Announce(string);
return true;
}
else if(chances >= 401 && chances <= 500)
{
new copmsg[250];
SendClientMessage(playerid, ERROR, "Your attempt to rob Ammunation failed!");
SendClientMessage(playerid, ERROR, "The Police are on their way to the store.");
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+ 5);
format(copmsg, sizeof(copmsg), "[HQ] %s attemped to rob Ammunation.", name);
SendRadioMessageToCops(copmsg);
Ammu3RecentlyRobbed = 100;
return true;
}
}
else if(Ammu3RecentlyRobbed > 0) return SendClientMessage(playerid, ERROR, "Ammunation has been robbed recently!");
}
else SendClientMessage(playerid, ERROR, "Your team cannot rob anything.");
}
if(CPS_IsPlayerInCheckpoint(playerid, cpammu4))
{
AMMUBOX[playerid] = 0;
if(gTeam[playerid] != COP && gTeam[playerid] != Medic && gTeam[playerid] != SWAT && gTeam[playerid] != FBI && gTeam[playerid] != ARMY)
{
if(Ammu4RecentlyRobbed == 0)
{
new chances = random(500);
if(chances >= 0 && chances <= 400)
{
new string[250];
RobAmmu4[playerid] = 20;
Ammu4RecentlyRobbed = 150;
format(string, sizeof(string), "%s[ID:%d] started a robbery at Ammunation!", name, playerid);
Announce(string);
return true;
}
else if(chances >= 401 && chances <= 500)
{
new copmsg[250];
SendClientMessage(playerid, ERROR, "Your attempt to rob Ammunation failed!");
SendClientMessage(playerid, ERROR, "The Police are on their way to the store.");
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+ 5);
format(copmsg, sizeof(copmsg), "[HQ] %s attemped to rob Ammunation.", name);
SendRadioMessageToCops(copmsg);
Ammu4RecentlyRobbed = 100;
return true;
}
}
else if(Ammu4RecentlyRobbed > 0) return SendClientMessage(playerid, ERROR, "Ammunation has been robbed recently!");
}
else SendClientMessage(playerid, ERROR, "Your team cannot rob anything.");
}
if(CPS_IsPlayerInCheckpoint(playerid, cpammu5))
{
AMMUBOX[playerid] = 0;
if(gTeam[playerid] != COP && gTeam[playerid] != Medic && gTeam[playerid] != SWAT && gTeam[playerid] != FBI && gTeam[playerid] != ARMY)
{
if(Ammu5RecentlyRobbed == 0)
{
new chances = random(500);
if(chances >= 0 && chances <= 400)
{
new string[250];
RobAmmu5[playerid] = 20;
Ammu5RecentlyRobbed = 150;
format(string, sizeof(string), "%s[ID:%d] started a robbery at Ammunation!", name, playerid);
Announce(string);
return true;
}
else if(chances >= 401 && chances <= 500)
{
new copmsg[250];
SendClientMessage(playerid, ERROR, "Your attempt to rob Ammunation failed!");
SendClientMessage(playerid, ERROR, "The Police are on their way to the store.");
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+ 5);
format(copmsg, sizeof(copmsg), "[HQ] %s attemped to rob Ammunation.", name);
SendRadioMessageToCops(copmsg);
Ammu5RecentlyRobbed = 100;
return true;
}
}
else if(Ammu5RecentlyRobbed > 0) return SendClientMessage(playerid, ERROR, "Ammunation has been robbed recently!");
}
else SendClientMessage(playerid, ERROR, "Your team cannot rob anything.");
}
return false;
}