21.01.2010, 22:28
Код:
if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0) { new tmpcar = GetPlayerVehicleID(playerid); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[128]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/m)egaphone [megaphone chat]"); return 1; } if (gTeam[playerid] != 2) { SendClientMessage(playerid, COLOR_GRAD2, " you are not part of a team"); return 1; } if(!IsACopCar(tmpcar)) { SendClientMessage(playerid, COLOR_GRAD2, " you are not in a police vehicle"); return 1; } format(string, sizeof(string), "[Officer %s:o< %s]", sendername, result); ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW); printf("%s", string); return 1; }
edit it to your own needs