SA-MP Forums Archive
CheckPoint - 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)
+--- Thread: CheckPoint (/showthread.php?tid=575255)



CheckPoint - StR_MaRy - 25.05.2015

hi to all, how can i do if i have a CheckPoint On to give a message like: You have already a checkpoint active , when i try to have another checkpoint like a have a sweeper job and place me checkpoints and if i type: /jobs taxi it place me a mark close to sweeper job and i get money like i did the mission.


Re: CheckPoint - Beckett - 25.05.2015

When you set the player's checkpoint make a global array.

pawn Код:
new bool:CP_Active[MAX_PLAYERS];

// When you set the checkpoint

CP_Active[playerid] = true;

// When you remove the checkpoint.

CP_Active[playerid] = false;

// When you want to check if player has an active checkpoint but tries to show another one
if(CP_Active[playerid] == true)
{
// code here
}

// Don't forget to reset it after disconnection
CP_Active[playerid] = false; // under OnPlayerDisconnect.