About a virtual world.
#1

How can i make it so, lets say i type a command, and it will go through all the players in game and whoever is on a virtual world number 75 will be set to virtual world 0?
Reply
#2

pawn Код:
if(strcmp(cmdtext,"/command",true) == 0)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
new VW = GetPlayerVirtualWorld(i);
        if(IsPlayerConnected(i))
        {
        if(VW == !0)
{
SetPlayerVirtualWorld(i,0);
}
}
}
}

untested but should work
Reply
#3

Код:
new i;
new vw; //virtual world

for(i=0;i<MAX_PLAYERS;i++)
{ 
  vw=GetPlayerVirtualWorld(i);
  if(vw==75)
  {
   SetPlayerVirtualWorld(i,0);
  }
}
Reply
#4

Код:
if(!strcmp(cmdtext,"/command",true))
{
  for(new i; i <MAX_PLAYERS; i++)
  {
    if(GetPlayerVirtualWorld(i) == 75)
    {
      SetPlayerVirtualWorld(i, 0);
    }
  }
  return 1;
}
Reply
#5

Quote:
Originally Posted by DJDhan
Код:
new i;
new vw; //virtual world

for(i=0;i<MAX_PLAYERS;i++)
{ 
  vw=GetPlayerVirtualWorld(i);
  if(vw==75)
  {
   SetPlayerVirtualWorld(i,0);
  }



}
mine would work, and you should use new vw = GetPlayerVirtualWorld(i);, anyways either one would work, just his only works for VW 75 if you want it for any vw just do if(vw ==!0), my code has a few mistakes i just woke up and i did it quickly, btw Hey wacko, lol
Reply
#6

Thanks guys!
Reply
#7

Quote:
Originally Posted by DevilRP
Thanks guys!
no problemo, looks like you got plenty of examples
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)