/w command
#4

pawn Код:
CMD:w(playerid, params[]) {
    new
        szMessage[128];

    if(isnull(params) || strlen(params) > 128) // No need to use sscanf, it's just 1 value
        return SendClientMessage(playerid, COLOR_ERROR, "USAGE: /w [message]");

    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) && PlayerToPlayer(playerid, i, < 10)) { // Check if they're connected & close enough
            format(szMessage, sizeof(szMessage), "%s(%d) whispered : %s", GetName(playerid), playerid, params);
            SendClientMessage(i, COLOR_PURPLE, szMessage); // Send the message only to the player who's close enough
        }
    }
    return 1;
}
Is this what you wanted? A message 'whispered' to all players within 10 distance units?
Reply


Messages In This Thread
/w command - by DarkLored - 29.03.2014, 22:04
Re: /w command - by Matess - 29.03.2014, 22:32
Re: /w command - by Brandon_More - 29.03.2014, 22:33
Re: /w command - by Calgon - 29.03.2014, 22:42
Re: /w command - by Konstantinos - 29.03.2014, 22:47

Forum Jump:


Users browsing this thread: 2 Guest(s)