Checkpoint?
#1

Hello
I have a quick question.
I wanted to make a checkpoint in the manor of:

Код:
new check1 = SetPlayerCheckpoint(playerid, x, y, z, 21);
How would I go about defining which checkpoint has which function?

Код:
public OnPlayerEnterCheckpoint(playerid)
{
if checkpoint is check1,
do this:
blah blah blah
}
thanks
Reply
#2

no one knows?
Reply
#3

There can be only one checkpoint created per player at time, so SetPlayerCheckpoint doesn't return ID and callback has only playerid parameter.
Reply
#4

what if I wanted one checkpoint to give you health at the spawn point, and one at the other side of San Andreas to kill you when you walk into it?
Reply
#5

Код:
public OnPlayerEnterCheckpoint(playerid)
{
for this here look on wiki :D
{
GivePlayerMoney(playerid,10000); or SetPlayerHealth(playerid,100); or SetPlayerHealth(playerid,0); ... i just give an example 
}
}
Reply
#6

Quote:
Originally Posted by Packer5
what if I wanted one checkpoint to give you health at the spawn point, and one at the other side of San Andreas to kill you when you walk into it?
Well, check if the player is near a point with https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

If they are, set a checkpoint where you want it.

Do the same with the other checkpoints.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)