23.05.2011, 14:42
I made a robebry system wich is working just that I wanna make it so if the player exits the checkpoint it cancels the timer
pawn Код:
public CountDown(playerid)
{
new string[128];
format(string, sizeof(string), " Stay in the marker for %d seconds to complete the robbery", countn);
GameTextForPlayer(playerid,string,10000,4);
countn--;
if(countn <= -1)
{
KillTimer(counttimer);
SetPlayerScore(playerid,GetPlayerScore(playerid) + 2);
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid) + 4);
new Float:money;
switch(money)
{
case 0:
{
if(IsPlayerInRangeOfPoint(playerid,3.0,377.0883,-115.8647,1001.4922))
{
GivePlayerMoney(playerid,1752);
GameTextForPlayer(playerid,"You robbed 1752$ from Well Stacked Pizza shop",3000,4);
new string1[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string1,sizeof(string1),"%s has robbed 1752$ from Well Stacked Pizza shop",pName);
SendClientMessageToAll(COLOR_GREY,string1);
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,-2235.9595,128.4391,1035.4141))
{
GivePlayerMoney(playerid,753);
GameTextForPlayer(playerid,"You robbed 753$ from RC electronics shop",3000,4);
new string2[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string2,sizeof(string2),"%s has robbed 753$ from RC electronics shop",pName);
SendClientMessageToAll(COLOR_GREY,string2);
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,379.6420,-8.8524,1001.8516))
{
GivePlayerMoney(playerid,1325);
GameTextForPlayer(playerid,"You robbed 1325$ from Cluckin' Bell shop",3000,4);
new string3[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string3,sizeof(string3),"%s has robbed 1325$ from Cluckin' Bell shop",pName);
SendClientMessageToAll(COLOR_GREY,string3);
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,378.3380,-65.0391,1001.5078))
{
GivePlayerMoney(playerid,853);
GameTextForPlayer(playerid,"You robbed 853$ from BurgerShot shop",3000,4);
new string4[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string4,sizeof(string4),"%s has robbed 853$ from BurgerShot shop",pName);
SendClientMessageToAll(COLOR_GREY,string4);
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,161.4013,-79.2683,1001.8047))
{
GivePlayerMoney(playerid,2200);
GameTextForPlayer(playerid,"You robbed 2200$ from ZIP shop",3000,4);
new string5[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string5,sizeof(string5),"%s has robbed 2200$ from ZIP shop",pName);
SendClientMessageToAll(COLOR_GREY,string5);
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,-202.0584,-5.0931,1002.2734))
{
GivePlayerMoney(playerid,1368);
GameTextForPlayer(playerid,"You robbed 1368$ from Hemlock Tatoo shop",3000,4);
new string6[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string6,sizeof(string6),"%s has robbed 1368$ from Hemlock Tatoo shop",pName);
SendClientMessageToAll(COLOR_GREY,string6);
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,418.5518,-75.7314,1001.8047))
{
GivePlayerMoney(playerid,354);
GameTextForPlayer(playerid,"You robbed 354$ from Barber's shop",3000,4);
new string7[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string7,sizeof(string7),"%s has robbed 354$ from Barber's shop",pName);
SendClientMessageToAll(COLOR_GREY,string7);
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,502.6806,-11.5208,1000.6797))
{
GivePlayerMoney(playerid,1520);
GameTextForPlayer(playerid,"You robbed 1520$ from Gayadaa Disco club",3000,4);
new string8[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string8,sizeof(string8),"%s has robbed 1520$ from Gayadaa Disco club",pName);
SendClientMessageToAll(COLOR_GREY,string8);
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,204.0275,-40.4131,1001.8047))
{
GivePlayerMoney(playerid,736);
GameTextForPlayer(playerid,"You robbed 736$ from SubUrban shop",3000,4);
new string9[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string9,sizeof(string9),"%s has robbed 736$ from SubUrban shop",pName);
SendClientMessageToAll(COLOR_GREY,string9);
}
else if(IsPlayerInRangeOfPoint(playerid,3.0,508.1718,-84.3275,998.9609))
{
GivePlayerMoney(playerid,963);
GameTextForPlayer(playerid,"You robbed 963$ from SubUrban shop",3000,4);
new string10[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string10,sizeof(string10),"%s has robbed 963$ from Mystic bar",pName);
SendClientMessageToAll(COLOR_GREY,string10);
}
}
}
}
return 1;
}
COMMAND:rob(playerid,params[])
{
if(gTeam[playerid] == TEAM_ROBBERS)
{
if(IsPlayerInRangeOfPoint(playerid,3.0,377.0883,-115.8647,1001.4922) || IsPlayerInRangeOfPoint(playerid,3.0,-2235.9595,128.4391,1035.4141) ||
IsPlayerInRangeOfPoint(playerid,3.0,379.6420,-8.8524,1001.8516) || IsPlayerInRangeOfPoint(playerid,3.0,378.3380,-65.0391,1001.5078) ||
IsPlayerInRangeOfPoint(playerid,3.0,161.4013,-79.2683,1001.8047) || IsPlayerInRangeOfPoint(playerid,3.0,-202.0584,-5.0931,1002.2734) ||
IsPlayerInRangeOfPoint(playerid,3.0,418.5518,-75.7314,1001.8047) || IsPlayerInRangeOfPoint(playerid,3.0,502.6806,-11.5208,1000.6797) ||
IsPlayerInRangeOfPoint(playerid,3.0,204.0275,-40.4131,1001.8047))
{
countn = 15;
counttimer = SetTimer("CountDown",1000,true);
}
if(GetPlayerInterior(playerid) == 0) return SendClientMessage(playerid,COLOR_FORESTGREEN,"This command can be used only on a shop");
}
if(gTeam[playerid] == TEAM_COPS || gTeam[playerid] == TEAM_MEDICS || gTeam[playerid] == TEAM_FIREFIGHTERS) return SendClientMessage(playerid,COLOR_RED,"This command is only for robbers");
return true;
}