teleport - 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)
+--- Thread: teleport (
/showthread.php?tid=536696)
teleport -
hillko - 11.09.2014
how to make teleport through the checkpoint
Re: teleport -
Stinged - 11.09.2014
-OnPlayerEnterCheckpoint (Or DynamicCP if you're using a streamer)
-(If you're using a streamer) if (cp == yourcp)
- SetPlayerPos
Re: teleport -
Eth - 11.09.2014
at the top of your script:
at ongamemodeinit:
pawn Код:
checkpoint = CreateDynamicCP(x,y,z,float:size,-1,-1,-1,Float:range);
example:
pawn Код:
checkpoint = CreateDynamicCP(0,0,0,2.0,-1,-1,-1,100.0);
Now we gonna add this function:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == checkpoint)
{
//Put your code here
}
return 1;
}
You can set his position or something..
make sure that you have streamer include
and make sure that you typed #include <streamer> at the top of your script.
you can download streamer from here:
https://sampforum.blast.hk/showthread.php?tid=102865
Re: teleport -
hillko - 11.09.2014
Quote:
Originally Posted by Eth
at the top of your script:
at ongamemodeinit:
pawn Код:
checkpoint = CreateDynamicCP(x,y,z,float:size,-1,-1,-1,Float:range);
example:
pawn Код:
checkpoint = CreateDynamicCP(0,0,0,2.0,-1,-1,-1,100.0);
Now we gonna add this function:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid) { if(checkpointid == checkpoint) { //Put your code here } return 1; }
You can set his position or something..
make sure that you have streamer include
and make sure that you typed #include <streamer> at the top of your script.
you can download streamer from here:
https://sampforum.blast.hk/showthread.php?tid=102865
|
Код HTML:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == checkpoint)
{
//Put your code here (and can code to write here how to write)
}
return 1;
}
Re: teleport -
hillko - 11.09.2014
Senks
Re: teleport -
Eth - 11.09.2014
just do like
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == checkpoint)
{
REPLACE THIS CODE WITH YOUR CODE
}
return 1;
}