Stupid easy question
#1

What is the call to teleport a player from their location to another one?
Reply
#2

SetPlayerPos
Reply
#3

Get the position of the player you wanted to be teleported to and make that your position! As easy as that!
Reply
#4

Thanks, +1 for the fast response.
Reply
#5

you didn't say what command processors soo..
pawn Код:
COMMAND:gethere(playerid, params[])
{
new targetid;
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid,COLOR_RED,""WHITE"Usage: "GREEN"/gethere "WHITE"[id]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID."RED"(Player Is Not Connected)!");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You can't use this command on yourself !");
new Float:X,Float:Y,Float:Z;new interior,world;new string[128];
GetPlayerName(targetid, giveplayer, sizeof(giveplayer));
GetPlayerPos(playerid, X, Y, Z);
interior = GetPlayerInterior(playerid);
world = GetPlayerVirtualWorld(playerid);
if(IsPlayerInAnyVehicle(targetid))
{
    SetVehiclePos(GetPlayerVehicleID(targetid),X+5,Y+3,Z);
    new vehicle = GetPlayerVehicleID(targetid);
    LinkVehicleToInterior(vehicle,interior);
    SetVehicleVirtualWorld(GetPlayerVehicleID(targetid), world);
}
else
{
    SetPlayerPos(targetid, X, Y+1, Z);
    SetPlayerInterior(targetid, interior);
    SetPlayerVirtualWorld(targetid, world);
}
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(string, sizeof(string), ""WHITE"You Have Teleported "ORANGE"\"%s\""WHITE" To Your Position.", giveplayer);
SendClientMessage(playerid,COLOR_WHITE, string);
format(string, sizeof(string), ""WHITE"You have Been Teleported by "ORANGE"\"%s\""WHITE" To His Position.", Name);
SendClientMessage(targetid, COLOR_WHITE, string);
return 1;
}
its from mREG
but without the admin stuff.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)