Question. [Real Easy] - 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: Question. [Real Easy] (
/showthread.php?tid=289918)
Question. [Real Easy] -
Daniel June - 13.10.2011
So I got some coordinates, I want, when a player enters cordinate 1 to teleport to cordinate 2. How do I do that? Under which public?
( If players enters cordinate (-2088.0269,2477.8394,48.3979) then he should TP to (-2076.4126,2475.6736,41.1647). )
Re: Question. [Real Easy] -
AeroBlast - 13.10.2011
pawn Код:
SetTimer("CheckPlayer",500,true);
Under OnGameModeInIt()
pawn Код:
forward CheckPlayer();
public CheckPlayer()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i,1,-2088.0269,2477.8394,48.3979))
{
SetPlayerPos(i,-2076.4126,2475.6736,41.1647);
}
}
}
return 1;
}
Somewhere in your script
Re: Question. [Real Easy] -
Josma_cmd - 13.10.2011
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, -2088.0269,2477.8394,48.3979))
{
SetPlayerPos(playerid, -2076.4126,2475.6736,41.1647);
}
You need of the timer or checkpoint.
Re: Question. [Real Easy] -
aRoach - 13.10.2011
You can use OnPlayerUpdate with IsPlayerInRangeOfPoint but it's better with Checkpoints
Re: Question. [Real Easy] -
Michael@Belgium - 13.10.2011
Quote:
Originally Posted by AeroBlast
pawn Код:
SetTimer("CheckPlayer",500,true);
Under OnGameModeInIt()
pawn Код:
forward CheckPlayer(); public CheckPlayer() { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInRangeOfPoint(i,1,-2088.0269,2477.8394,48.3979)) { SetPlayerPos(i,-2076.4126,2475.6736,41.1647); } } } return 1; }
Somewhere in your script
|
Don't need a timer xD
This should work:
Quote:
Originally Posted by Josma_cmd
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, -2088.0269,2477.8394,48.3979)) { SetPlayerPos(playerid, -2076.4126,2475.6736,41.1647); }
You need of the timer or checkpoint.
|
Re: Question. [Real Easy] -
=WoR=Varth - 13.10.2011
Or pickup.