14.04.2013, 01:27
I created a /Get command to teleport a player to my location but it says he is not online and teleports myself to my location? O.o
I'm still new into this..
pawn Код:
CMD:get(playerid, params[])
{
new OtherPlayer, Float:x, Float:y, Float:z, PortMsg[128], IntID, WorldID, Name[24];
if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/get [id]\"");
if (IsPlayerConnected(OtherPlayer))
GetPlayerName(OtherPlayer, Name, sizeof(Name));
GetPlayerPos(playerid, x, y, z);
IntID = GetPlayerInterior(playerid);
WorldID = GetPlayerVirtualWorld(playerid);
SetPlayerVirtualWorld(OtherPlayer, WorldID);
SetPlayerInterior(OtherPlayer, IntID);
SetPlayerPos(OtherPlayer, x, y, z + 3.0);
format(PortMsg, 128, "|-You teleported %s to your location-|", Name);
SendClientMessage(playerid, COLOR_RED, PortMsg);
}
else
SendClientMessage(playerid, COLOR_RED, "{FF0000}Error: {FFFFFF}That player is not online");
return 1;
}