29.03.2014, 22:42
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;
}