23.03.2014, 04:33
Код:
CMD:s(playerid,params[]) { if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /s [text] to talk to nearest person"); new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); new string[128], Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); format(string, sizeof(string), "[%s] says: %s", Name, params[0]); new str[128]; format(str, sizeof(str),"[SAY] %s: %s", Name, params[0]); printf("%s", string); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,50.0, x, y, z) ) SendClientMessage(i, COLOR_RED, string); } return 1; }
Edit: identation is also fixed,ok gshock