27.09.2012, 18:32
Ok i have this timer
this is when you rob a store (burger or zero) but when it sets the timer (RB) it will set the store robable in 5 minutes but it does it for all stores. i know a way to get round this but it means making more timers and i would think there is an easy way of doing it instead of making one timer per shop or something
pawn Код:
public Rob(playerid)
{
if(IsPlayerInDynamicCP(playerid, burgerrob) || IsPlayerInDynamicCP(playerid, zero))
{
countn[playerid]--;
new string[128];
format(string, sizeof(string), "Attempting robbery~n~~b~%i~n~~r~Stay in the checkpoint", countn[playerid]);
TextDrawSetString(robbery, string);
TextDrawShowForPlayer(playerid, robbery);
}
if(countn[playerid] <= 0)
{
if(IsPlayerInDynamicCP(playerid, burgerrob) || IsPlayerInDynamicCP(playerid, zero))
{
RobbedR = true;
SetTimer("BR", 300000, true);
new money = random(50000);
GivePlayerMoney(playerid, money);
new rob[128];
format(rob, sizeof(rob), "~g~Robbed $%i", money);
PlayerTextDrawSetString(playerid, moneyhere[playerid], rob);
SetTimer("destroyrob", 3000, false);
PlayerTextDrawShow(playerid, moneyhere[playerid]);
KillTimer(dstimer[playerid]);
TextDrawHideForPlayer(playerid, robbery);
}
}
return 1;
}