Players getting same message when in same interior and virtual world. - 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: Players getting same message when in same interior and virtual world. (
/showthread.php?tid=289141)
Players getting same message when in same interior and virtual world. -
Jack_Leslie - 10.10.2011
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?
Re: Players getting same message when in same interior and virtual world. -
[MG]Dimi - 10.10.2011
PHP код:
for(new i=0;i<MAX_PLAYERS;i++)
if(GetPlayerInterior(playerid) == GetPlayerInterior(i))
{
//if they are in same interior here
}
Re: Players getting same message when in same interior and virtual world. -
Jack_Leslie - 10.10.2011
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.
Re: Players getting same message when in same interior and virtual world. -
[MG]Dimi - 10.10.2011
Make your own function using stock. SOmething like SendIntMessage like this one:
PHP код:
stock SendIntMessage(playerid,COLOR,message[])
{
for(new i=0; i<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