21.12.2012, 01:27
I added this to my gamemode and it doesnt teleport the player to my location, it teleports me to them
Код:
CMD:gethere(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new id; if(sscanf(params, "r", id)) return SendClientMessage(playerid, 0x333666, "Correct usage: /gethere [ID]"); if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0x333666, "Invalid playerid"); new Float:Pos[4], string[45], playeridname[MAX_PLAYER_NAME+1], idname[MAX_PLAYER_NAME+1]; SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id)); SetPlayerInterior(playerid, GetPlayerInterior(id)); GetPlayerPos(id, Pos[0], Pos[1], Pos[2]); GetPlayerFacingAngle(id, Pos[3]); SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); SetPlayerFacingAngle(playerid, Pos[3]); GetPlayerName(id, idname, sizeof(idname)); format(string, sizeof(string), "You have teleported %s to you.", idname); SendClientMessage(playerid, 0x333666, string); GetPlayerName(playerid, playeridname, sizeof(playeridname)); format(string, sizeof(string), "%s has teleported you to them", playeridname); SendClientMessage(id, 0x333666, string); } else { SendClientMessage(playerid, COLOR_RED, "You cannot use that command"); } return 1; }