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