help, Global Chat/near chat
#1

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
Reply
#2

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
Reply
#3

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.
Reply
#4

First of all i didn't took it from my gamemode
Second one i mentioned that you must define those before compile.

Regards
Reply
#5

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.
Reply
#6

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"
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)