SA-MP Forums Archive
Target 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: Target teleport (/showthread.php?tid=440150)



Target teleport - jimangel2001 - 28.05.2013

Hi i am playing on a server where when you target a place in the map you get teleported there.Can someone help me scripting and give me an idea how to get the position of the target?
(for my server)
Thanks


Re: Target teleport - nielsbon1 - 28.05.2013

Well to get a player position you first need a targetid you can use sscanf for this, so when you create a command you can add a targetid in it. After that you can get the target ID position. Like i did with GetPlayerPos with a Float then you can set your own player position to the position you saved ofcourse + 2 so you won't spawn on the player and you can also goto a interior if the player is in a interior at the moment.

pawn Код:
new targetid, Float:pPos[3];
GetPlayerPos(targetid, pPos[0], pPos[1], pPos[2]);
SetPlayerPos(playerid, pPos[0]+2, pPos[1], pPos[2]);
SetPlayerInterior(playerid, GetPlayerInterior(targetid));



Re : Target teleport - Stefano.R - 28.05.2013

Hi,
pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    SetPlayerPosFindZ(playerid, fX, fY, fZ);
    return 1;
}



Re: Target teleport - Guest123 - 28.05.2013

use this

pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    SetPlayerPosFindZ(playerid, fX, fY, fZ);
    return 1;
}
EDIT: Stefano.R faster than me :/


Re: Target teleport - jimangel2001 - 28.05.2013

Thaaank you very very much!