27.04.2013, 21:49
Try it
pawn Код:
CMD:tp(const playerid, const params[])
{
new targetid, target[MAX_PLAYER_NAME], Float:x, Float:y, Float:z;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /tp [id]");
if(u == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "your message here");
GetPlayerName(targetid, target, sizeof(target)), GetPlayerPos(targetid, x, y, z);
if(IsPlayerInAnyVehicle(playerid))
{
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
new veh = GetPlayerVehicleID(playerid);
LinkVehicleToInterior(veh, GetPlayerInterior(targetid));
SetVehicleVirtualWorld(veh, GetPlayerVirtualWorld(targetid));
SetVehiclePos(veh, x, y + 5, z + 1);
}
else SetPlayerPos(playerid, x, y, z + 1), SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid)), SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SendClientMessage(targetid, COLOR_WHITE, "An admin teleported to you.");
return 1;
}