Help with this CP - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with this CP (
/showthread.php?tid=260934)
Help with this CP -
Face9000 - 11.06.2011
Hi guys,i created a checkpoint to blow up area69,all is working but there is a problem.
Here is the code
pawn Код:
if(checkpointid == CPs[0])
{
if (GetPlayerMoney(playerid) < 50000)
{
SendClientMessage(playerid, 0xFFFFFF, "You need 50.000$ to bomb the Area69.");
}
else if(GetPlayerMoney(playerid) > 50000)
{
GivePlayerMoney(playerid,-50000);
SetTimer("ExplodeArea69",25000,false);
SendClientMessage(playerid,COLOR_RED,"*Area69 bombed! You have 25 seconds to escape!");
new str[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(str,sizeof str,"0,4%s bombed the Area69. ",pName);
IRC_GroupSay(IRC_Group, EchoChan,str);
}
}
The CP is a little bugged,i need to add a limit.
Ex: You are already bombing,please wait.
How?
Re: Help with this CP -
0ne - 11.06.2011
set a timer and on the timers callback put the explode code(what happens when the 25secs pass)
Re: Help with this CP -
Sascha - 11.06.2011
add a global variable in combination with a timer..
when a player enters the checkpoint check the variable and if it's "0" then set it to "1" and start the timer + bombin and stuff..
when the variable already is at "1" it shows the wait message