Help[OnPlayerEnterCheckpoint]
#1

Hello,

I made a random checkpoints,and now I do not know how to do OnPlayerEnterCheckpoint for them.

I used:

Код:
new Float:checkpoints[][] = {
{-22.2549,-55.6575,1003.5469,2.0},
{295.7192,-80.4445,1001.5156,5.0},
{-1957.5327,300.2131,35.4688,2.0}
};
In command:
Код:
new rand = random(sizeof(checkpoints));
SetPlayerCheckpoint(playerid,checkpoints[rand][0],checkpoints[rand][1],checkpoints[rand][2],checkpoints[rand][3]);
I want to when a player comes to the checkpoint to get the message example "You have successfully performed the mission"

Please someone help,thanks
Reply
#2

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

https://sampwiki.blast.hk/wiki/SendClientMessage
Reply
#3


I know how to make "OnPlayerEnterCheckpoint" when using normal checkpoint, but these are random checkpoints.Because then the script then looks like this:


In command:
Код:
SetPlayerCheckpoint(playerid, 1541.7793,-1673.6117,13.5532,8.0);
CP[playerid] = 1;
In OnPlayerEnterCheckpoint:
Код:
	else if(CP[playerid] == 1)
	{
	  GameTextForPlayer(playerid, "~y~Hello", 2500, 1);
	  DisablePlayerCheckpoint(playerid);
	}
A random checkpoints at the command looks like this:
Код:
new rand = random(sizeof(checkpoints));
SetPlayerCheckpoint(playerid,checkpoints[rand][0],checkpoints[rand][1],checkpoints[rand][2],checkpoints[rand][3]);
there is a difference
Reply
#4

Then add this:

pawn Код:
new rand = random(sizeof(checkpoints));
SetPlayerCheckpoint(playerid,checkpoints[rand][0],checkpoints[rand][1],checkpoints[rand][2],checkpoints[rand][3]);
CP[playerid] = rand;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)