Target teleport
#1

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
Reply
#2

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));
Reply
#3

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

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 :/
Reply
#5

Thaaank you very very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)