help, Global Chat/near chat - 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: help, Global Chat/near chat (
/showthread.php?tid=567104)
help, Global Chat/near chat -
StarPeens - 10.03.2015
How do I make a global chat? when the player press "T" open chat and he enter a message, send only to who is near to him, and if you want to send a message to all he has to enter /g [text] +REP
Re: help, Global Chat/near chat -
chsulaj - 11.03.2015
Here you go, if this is not what you're talking about please let me know about it.
+rep!
Also do not forgot to define the color and OOCPower and OOCOff
http://pastebin.com/2EZYfmer
Regards
Re: help, Global Chat/near chat -
StarPeens - 11.03.2015
but where the chat for near peoples? if u answer i will give u +rep..
@I analyzed your code will not work, you took your gamemode, has more functions to do.
Re: help, Global Chat/near chat -
chsulaj - 11.03.2015
First of all i didn't took it from my gamemode
Second one i mentioned that you must define those before compile.
Regards
Re: help, Global Chat/near chat -
chsulaj - 11.03.2015
For Near Chat here you go :
http://pastebin.com/3vy5SSeY
Instead of COLOR_WHITE you can use as a default one by using (-1) if you want just define the color and all good.
Re: help, Global Chat/near chat -
StarPeens - 11.03.2015
how define it ?
pawn Код:
C:\Users\Jean\f\f\gamemodes\e.pwn(2407) : error 017: undefined symbol "SendClientMessageEx"
C:\Users\Jean\f\f\gamemodes\e.pwn(2409) : error 017: undefined symbol "GetPlayerNameEx"
C:\Users\Jean\f\f\gamemodes\e.pwn(2411) : error 017: undefined symbol "GetPlayerNameEx"
C:\Users\Jean\f\f\\e.pwn(2412) : error 017: undefined symbol "ProxDetector"
C:\Users\Jean\f\f\gamemodes\e.pwn(2413) : error 017: undefined symbol "PlayerInfo"
Re: help, Global Chat/near chat -
CalvinC - 11.03.2015
Just loop through all players, and check if they're near the player that wrote, and then send the message.
pawn Код:
public OnPlayerText(playerid, text[])
{
new Float:x, Float:y, Float:z; // Declares 3 floats
GetPlayerPos(playerid, x, y, z); // Store the position of the player that wrote in the floats we created
foreach(new i : Player) // Loop through all players, and define them as "i"
{
if(IsPlayerInRangeOfPoint(i, range, x, y, z)) SendPlayerMessageToPlayer(playerid, i, text);
// If "i" is in range of the xyz (which is the position of the player that wrote) send him the message, change the range to the distance you want
}
return 1;
}
In /g, just use Send Player/Client MessageToAll.