Players getting same message when in same interior and virtual world.
#1

Hi guys.

My house system I am creating using the unique house id to set the players virtual world to separate interior ids. Except, people in the same interior and different virtual world can still see what their client sends (like a message..), but I don't want them too.

Is there any quick and easy way of making it send to only the same virtual world?
Reply
#2

PHP код:
for(new i=0;i<MAX_PLAYERS;i++)
if(
GetPlayerInterior(playerid) == GetPlayerInterior(i))
{
//if they are in same interior here

Reply
#3

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
PHP код:
for(new i=0;i<MAX_PLAYERS;i++)
if(
GetPlayerInterior(playerid) == GetPlayerInterior(i))
{
//if they are in same interior here

Is that the only way? There's no way to limit it to the same virtual world? I'm using YCMD... I don't really wanna go through every single damn command and put that in.
Reply
#4

Make your own function using stock. SOmething like SendIntMessage like this one:
PHP код:
stock SendIntMessage(playerid,COLOR,message[])
{
    for(new 
i=0i<MAX_PLAYERS;i++)
    if(
IsPlayerConnected(i))
    {
        if(
GetPlayerInterior(playerid) == GetPlayerInterior(i))
        {
            if(
GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                
SendClientMessage(i,COLOR,message);
            }
        }
    }

This one will send message to all players in same interior and virtual world as sender.

EDIT: Wait. This might wont work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)