Help With Checkpoints - 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 Checkpoints (
/showthread.php?tid=71202)
Help With Checkpoints -
borg245 - 30.03.2009
Hello,
so if i want 5 people to enter the checkpoint before i execute another action, how do i do that?
Ive got something but i want to enter a code to make there be 5 people who have to go in the checkpoint so i can execute another action.
Код:
public OnPlayerEnterCheckpoint(playerid)
{
GameTextForPlayer(playerid,"~R~You have reached the control centre",4000,3);
SendClientMessageToAll(COLOR_RED,"One of the Attackers has Reached The Control Centre");
GivePlayerMoney(playerid, 0);
DisablePlayerCheckpoint(playerid);
return 1;
}
Does anyone know? thanks
Re: Help With Checkpoints -
Nubotron - 31.03.2009
Try something like this
pawn Код:
new players_in_checkpoint;
public OnPlayerEnterCheckpoint(playerid)
{
GameTextForPlayer(playerid,"~R~You have reached the control centre",4000,3);
SendClientMessageToAll(COLOR_RED,"One of the Attackers has Reached The Control Centre");
GivePlayerMoney(playerid, 0);
DisablePlayerCheckpoint(playerid);
if (++players_in_checkpoint == 5)
//there are 5 players in checkpoint, do your next action
return 1;
}
Re: Help With Checkpoints -
Mikep - 31.03.2009
pawn Код:
new CheckpointVisitors;
public OnPlayerEnterCheckpoint(playerid)
{
GameTextForPlayer(playerid,"~R~You have reached the control centre",4000,3);
SendClientMessageToAll(COLOR_RED,"One of the Attackers has Reached The Control Centre");
GivePlayerMoney(playerid, 0);
DisablePlayerCheckpoint(playerid);
CheckpointVisitors++;
if(CheckpointVisitors == 5)
{
//Do what you wan't
}
return 1;
}
Re: Help With Checkpoints -
borg245 - 31.03.2009
I thank you both thourghily, sorry for the newbness.
:P
SOLVED