[Help] Chat on 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Chat on virtual worlds (
/showthread.php?tid=71922)
[Help] Chat on virtual worlds -
Diablo1st - 04.04.2009
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
Re: [Help] Chat on virtual worlds -
Think - 04.04.2009
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
Re: [Help] Chat on virtual worlds -
Diablo1st - 04.04.2009
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?
Re: [Help] Chat on virtual worlds -
MenaceX^ - 04.04.2009
pawn Код:
if(GetPlayerVirtualWorld(i)==GetPlayerVirtualWorld(playerid)&&GetPlayerInterior(i)==GetPlayerInterior(playerid))//In ProxDetector
Shorter
Re: [Help] Chat on virtual worlds -
Diablo1st - 05.04.2009
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