Virtual worlds
#1

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.
Reply
#2

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;
}
Reply
#3

REMOVED, didn't see above.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)