01.10.2012, 17:52
Hello, how to make that only administrators wrote in a chat when players use the command. For example: a player "Nickname" uses the command "/car"?
Код:
COMMAND:car(playerid, params[]) { if(Player[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, COLOR_RED, "Вы не администратор."); { new string[128], carid, carcolor1, carcolor2; if(!sscanf(params, "iii", carid, carcolor1, carcolor2)){ if(carid >= 400 && carid <= 611){ if(carcolor1 >= 0 && carcolor1 <= 252){ if(carcolor2 >= 0 && carcolor2 <= 252){ new Float:X, Float:Y, Float:Z; GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerPos(playerid, X, Y, Z); CreateVehicle(carid, X+4, Y, Z, 10, carcolor1, carcolor2, 100); format(string, sizeof(string), "Вы заспавнили автомобиль %s [ID: %d] с цветами [%d, %d]",VehicleNames[carid-400], carid, carcolor1, carcolor2); return SendClientMessage(playerid,COLOR_GREEN, string);} else return SendClientMessage(playerid, COLOR_RED, "Неверный ID цвета!Используйте числа от 0 до 252.");} else return SendClientMessage(playerid, COLOR_RED, "Неверный ID цвета!Используйте числа от 0 до 252.");} else return SendClientMessage(playerid, COLOR_RED, "Неверный ID транспорта!Используйте от 400 до 611.");} else return SendClientMessage(playerid, COLOR_GREEN, "Используйте: /car [ID] [цвет 1][цвет 2]."); } }