How to send a global message?
#6

Global means everyone. Anyway, here:

pawn Код:
if(!strcmp("/l", cmd))
{
    new inputmessage[128], message[128], name[MAX_PLAYER_NAME], Float:X, Float:Y, Float:Z;
    inputmessage = strrest(cmdtext, idx);
    if(!strlen(inputmessage)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /l [message]");
    if(strlen(inputmessage) > 128) return SendClientMessage(playerid, COLOR_RED, "ERROR: Message too long, try again.");
    GetPlayerName(playerid, name, sizeof(name));
    format(message, sizeof(message), "%s(%d) says: %s", name, playerid, inputmessage);
    GetPlayerPos(playerid, X, Y, Z);
    for(new i; i <= MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 20, X, Y, Z)) {
            SendClientMessage(i, COLOR_PURPLE, message);
        }
    }
    return 1;
}
Reply


Messages In This Thread
How to send a global message? - by KennethRandall - 02.08.2010, 20:21
Re: How to send a global message? - by cofy1 - 02.08.2010, 20:40
Re: How to send a global message? - by Hiddos - 02.08.2010, 20:40
Re: How to send a global message? - by KennethRandall - 02.08.2010, 20:43
Re: How to send a global message? - by KennethRandall - 02.08.2010, 20:46
Re: How to send a global message? - by Conroy - 02.08.2010, 21:19
Re: How to send a global message? - by KennethRandall - 02.08.2010, 21:30
Re: How to send a global message? - by Conroy - 02.08.2010, 21:45

Forum Jump:


Users browsing this thread: 1 Guest(s)