How to send a global message?
#8

pawn Код:
if(!strcmp("/l", cmd))
{
    new inputmessage[128], message[128], name[MAX_PLAYER_NAME];
    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);
    for(new i; i <= MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 20, /*X coord, Y coord, Z coord*/)) {
            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)