Cmd about virtual worlds
#1

i want to make a command that when the command is typed
it should set all players Virtualworld to 0 if they are in a specific virtual world eg: 120

is this possible??

if yes please tell me how
Reply
#2

pawn Код:
CMD:setvworld(playerid,params[]) //Created Just Now check if this works or not.
{
 if(IsPlayerAdmin(playerid))
  {
   new vworld;
   if(sscanf(params,"i",vworld))
   {
   SendClientMessage(playerid,-1,"/setvworld [world id]");
   return 1;
   }
   else
   {
   for(new i=0;i<MAX_PLAYERS;i++)
   {
    if(IsPlayerConnected(i))
    {
     if(GetPlayerVirtualWorld(i) == 56) //or any world ID according to your specification.
     {
     SetPlayerVirtualWorld(i,vworld);
     }
    }
   }
   }
  }
  else
  {
   SendClientMessage(playerid,-1,"you are not an admin");
   return 1;
  }
  return 1;
}
EDIT: Specified the Virtual World.
Reply
#3

and this command should only work if the player is in specific world like 56 or something

when the command is used the players in world 56 should be set to 0 not all the players.
Reply
#4

Edited the above code.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)