Enterable checkpoint
#2

pawn Code:
new TPCPActive[MAX_PLAYERS]
stock CreateTPCP(playerid)
{
SetPlayerCheckPoint(playerid, x, y, z, size);
TPCPActive[playerid] = true;
}

public OnPlayerDisconnect(playerid)
{
TPCPActive[playerid] = false;
}

public OnPlayerEnterCheckpoint(playerid)
{
if(TPCPActive[playerid] == true) {
SetPlayerPos(playerid, newx, newy, newz);
SendClientMessage(playerid, -1, "You have been teleported due to entering the TP checkpoint."); }
return 1;
}
Along with setting the checkpoint for the player we want to have a variable to know if the checkpoint is active for them. If they enter a checkpoint, whilist the TP variable is set to true it will teleport them to the coordinates you want. Obviously, replace details like x, y, z, and size with the ones you want. For more information,

https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint
Reply


Messages In This Thread
Enterable checkpoint - by yvoms - 15.05.2014, 23:44
Re: Enterable checkpoint - by Abagail - 15.05.2014, 23:51
Re: Enterable checkpoint - by yvoms - 15.05.2014, 23:55
Re: Enterable checkpoint - by Abagail - 16.05.2014, 00:01
Re : Enterable checkpoint - by Ramoboss - 16.05.2014, 00:11

Forum Jump:


Users browsing this thread: 1 Guest(s)