30.06.2017, 20:55
Hi there - many thanks for the reply!
Is it possible to do something similar to /goto instead? This teleports the player + vehicle:
Is it possible to do something similar to /goto instead? This teleports the player + vehicle:
Code:
CMD:goto(playerid, params[]) { if(PlayerInfo[playerid][Level] < 2 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, red, "ERROR: You are not a high enough level admin to use this command."); new player1, string[128]; if(sscanf(params, "u", player1)) return SendClientMessage(playerid, red, "USAGE: /goto [playerid]"); if(player1 == INVALID_PLAYER_ID) return SendClientMessage(playerid, red, "ERROR: Player is not connected."); CMDMessageToAdmins(playerid,"GOTO"); new Float:x, Float:y, Float:z; GetPlayerPos(player1, x, y, z); SetPlayerInterior(playerid, GetPlayerInterior(player1)); SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(player1)); if(GetPlayerState(playerid) == 2) { SetVehiclePos(GetPlayerVehicleID(playerid), x+3, y, z); LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(player1)); SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(player1)); } else SetPlayerPos(playerid, x+2, y, z); format(string, sizeof(string), "You have teleported to \"%s\"", pName(player1)); SendClientMessage(playerid, green, string); return 1; }