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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checkpoint? (
/showthread.php?tid=106584)
Checkpoint? -
Packer5 - 04.11.2009
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
Re: Checkpoint? -
Packer5 - 05.11.2009
no one knows?
Re: Checkpoint? -
Sergei - 05.11.2009
There can be only one checkpoint created per player at time, so SetPlayerCheckpoint doesn't return ID and callback has only playerid parameter.
Re: Checkpoint? -
Packer5 - 05.11.2009
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?
Re: Checkpoint? -
Lajko1 - 05.11.2009
Код:
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
}
}
Re: Checkpoint? -
MachineHead - 05.11.2009
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.