2021-02-18, 05:28 PM
PHP Code:
CMD:goto(playerid, params[]) {
?
? ? ? ? if (!sscanf(params, "d", params[0])) {
? ? ? ? ? ? if (IsPlayerConnected(params[0])) {
? ? ? ? ? ? ? ? if(GetPlayerVirtualWorld(params[0]) != GetPlayerVirtualWorld (playerid)) return SendClientMessage(playerid, -1, "Nope");
? ? ? ? ? ? ? ? new Float: p_x,Float: p_y,Float: p_z;
? ? ? ? ? ? ? ? GetPlayerPos(params[0], p_x, p_y, p_z);
? ? ? ? ? ? ? ? new interior = GetPlayerInterior(params[0]);
? ? ? ? ? ? ? ? new vw = GetPlayerVirtualWorld(params[0]);
? ? ? ? ? ? ? ? SetPlayerPos(playerid, p_x, p_y, p_z);
? ? ? ? ? ? ? ? SetPlayerInterior(playerid, interior);
? ? ? ? ? ? ? ? SetPlayerVirtualWorld(playerid, vw);
? ? ? ? ? ? ? ? return SendClientMessage(playerid, -1, "Teleported.");
? ? ? ? ? ? } else SendClientMessage(playerid, -1, "Player not found.");
? ? ? ? } else SendClientMessage(playerid, -1, "/goto [playerid]");
? ? ? ? return 1;