• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] How i can add this to my command?
#1
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?





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
  Reply


Messages In This Thread
How i can add this to my command? - by Nicolas_Belic - 2021-02-18, 10:34 AM

Forum Jump: