SA-MP Forums Archive
Virtual worlds - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Virtual worlds (/showthread.php?tid=98520)



Virtual worlds - ded - 21.09.2009

Hi there, I was wondering if somebody could tell me how I can limit global chat to one world.

For example, if a player switches to a new world he won't be able to see the chat from the main world (0) and the people in the main world won't be able to see his chat.


Re: Virtual worlds - Zeex - 21.09.2009

https://sampwiki.blast.hk/wiki/GetPlayerVirtualWorld
pawn Код:
public OnPlayerText(playerid, text[])
{
  new
    world = GetPlayerVirtualWorld(playerid);
  for (new i; i < MAX_PLAYERS; i++)
  {
    if (world == GetPlayerVirtualWorld(i)
    {
      SendPlayerMessageToPlayer(i, playerid, text);
    }  
  }
  return 0;
}



Re: Virtual worlds - Finn - 21.09.2009

REMOVED, didn't see above.


Re: Virtual worlds - ded - 21.09.2009

Quote:
Originally Posted by ZeeX
https://sampwiki.blast.hk/wiki/GetPlayerVirtualWorld
pawn Код:
public OnPlayerText(playerid, text[])
{
  new
    world = GetPlayerVirtualWorld(playerid);
  for (new i; i < MAX_PLAYERS; i++)
  {
    if (world == GetPlayerVirtualWorld(i)) // Added missing bracket :+
    {
      SendPlayerMessageToPlayer(i, playerid, text);
    }  
  }
  return 0;
}
Figured it out in the end thanks though.