2021-02-18, 10:34 AM
Hi, how can I make it so that only I can teleport to people who are in the same virtual world and cannot if the virtual world is different?
Correct me please
Code:
CMD:goto(playerid, params[]) {
? ?
? ? ? ? if (!sscanf(params, "d", params[0])) {
? ? ? ? ? ? if (IsPlayerConnected(params[0])) {
? ? ? ? ? ? ? ? if(GetPlayerVirtualWorld(params[0]) == GetPlayerVirtualWorld (playerid)) else 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;
}
Correct me please