OnPlayerEnterCheckpoint - 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: OnPlayerEnterCheckpoint (
/showthread.php?tid=173440)
OnPlayerEnterCheckpoint -
Kuruskt - 02.09.2010
I'm total beginner at pawno so I'm coming here for some support.
I was wondering if it's possible that when I drive ( with a car ) on created
"SetPlayerCheckpoint" it teleports me to another destination. If yes, I would appreciate if someone would create a little example or tutorial.
Thank you.
Re: OnPlayerEnterCheckpoint -
[XST]O_x - 02.09.2010
EDIT:
I'm so sorry that I've misread,I thought you're asking how you can teleport from one checkpoint to another.
Sorry!
Re: OnPlayerEnterCheckpoint -
CyNiC - 02.09.2010
First, you set the checkpoint for the playerid, so make it:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
SetPlayerCheckpoint(...);
}
return 1;
}
And to set the vehicle pos:
pawn Код:
public OnPlayerEnterCheckPoint(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
}
return 1;
}
Re: OnPlayerEnterCheckpoint -
Kuruskt - 02.09.2010
Alright, thanks for help, but how to change the size of CP? For me it's huge...
Re: OnPlayerEnterCheckpoint -
Vince - 02.09.2010
The last param in SetPlayerCheckpoint declares the size. 1.5 to 2.5 is a reasonable size for a checkpoint.