02.08.2010, 21:45
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;
}