SA-MP Forums Archive
Is it possible to make seperated chats in 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)
+--- Thread: Is it possible to make seperated chats in virtual worlds ? (/showthread.php?tid=494882)



Is it possible to make seperated chats in virtual worlds ? - xPirate - 15.02.2014

Hello
[*] I want to know if its possible to make seperated chats in different worlds.

For example, Stunting world has its own chat and Roleplay world has its on chat ( virtual worlds )
Any help / tip would be helpful.


Re: Is it possible to make seperated chats in virtual worlds ? - Yashas - 15.02.2014

You can do it manually.Returning 0 on OnPlayerText will not send the message.

First Get the virtual world of the player.Then a for loop(or foreach) to loop through all the player with the same virtual world and SendClientMessage to them.At the end return 0.

Код:
public OnPlayerText(playerid,text[])
{
     new msg[128];
      new vw = GetPlayerVirtualWorld(playerid);
      format(msg,sizeof(msg),"%s:%s",playername,text);
      for(new i = 0;i < maxplayers;i++)
      {
            if(GetPlayerVirtualWorld(i) == vw)
                SendClientMessage(i,color,msg);
        }
return 0;
}