[Help] Chat on virtual worlds
#1

hello,
i have find a little problem with chat in different virtual worlds for example:
we have 2 guys A and B, A is somewhere and B is in the same place where A is, but they have different Virtual Worlds, They don't see each others but they can talk, that's something like a bug i would like that only if players are in the same Virtual Worlds can talk:

here is the code of the chat under OnPlayerText:
pawn Код:
GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "%s: %s", sendername, text);
        ProxDetector(8.5, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
can some one give me the code to make only if the virtual world is same players can see the text? (A and B have same virtual world)
thanks again
Reply
#2

hm,

pawn Код:
new pvirtual1 = GetPlayerVirtualWorld(playerid);
for(new i=0;i<MAX_PLAYERS;i++)
{
 new pvirtual2 = GetPlayerVirtualWorld(i);
 if(pvirtual1 == pvirtual2)
 {
 SendPlayerMessageToPlayer(playerid, i, text);
 return 0;
 }
 else
 {
 return 0;
 }
}
something like that
Reply
#3

Quote:
Originally Posted by Pandabeer1337
hm,

pawn Код:
new pvirtual1 = GetPlayerVirtualWorld(playerid);
for(new i=0;i<MAX_PLAYERS;i++)
{
 new pvirtual2 = GetPlayerVirtualWorld(i);
 if(pvirtual1 == pvirtual2)
 {
 SendPlayerMessageToPlayer(playerid, i, text);
 return 0;
 }
 else
 {
 return 0;
 }
}
something like that
thanks you i can't really test it out because i got some problems but i will when is possible,
i was also thinking : maybe need to edit the ProxDetector function because (using the same example) if A use a command (for example give guns) to B and they have different virtual world B will still recive the Gun, so someone think about this situation? and have a solution?
Reply
#4

pawn Код:
if(GetPlayerVirtualWorld(i)==GetPlayerVirtualWorld(playerid)&&GetPlayerInterior(i)==GetPlayerInterior(playerid))//In ProxDetector
Shorter
Reply
#5

Quote:
Originally Posted by MenaceX^
pawn Код:
if(GetPlayerVirtualWorld(i)==GetPlayerVirtualWorld(playerid)&&GetPlayerInterior(i)==GetPlayerInterior(playerid))//In ProxDetector
Shorter
thanks you , i'm going to test it but i think it will work, also i'm going now to try fix the Lock/Unlock command for all players plus the player will join the server
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)