Всем привет. Представляю вашему вниманию команду /adminduty. ко всем new добавляем Code new Hentum1[MAX_PLAYERS]; new number1[MAX_PLAYERS]; new count1[MAX_PLAYERS]; new Text3D:Label1[MAX_PLAYERS]; forward ColorUpdate(playerid); new Colors[25] = { 0xFF0000FF, 0xFF2C00FF, 0xFF5000FF, 0xFF8700FF, 0xFFA700FF, 0xFFDC00FF, 0xFFFB00FF, 0xC4FF00FF, 0x7BFF00FF, 0x00FF00FF, 0x00FF1EFF, 0x00FF3BFF, 0x00FF7CFF, 0x00FFAEFF, 0x00FFD5FF, 0x00FFFFFF, 0x00CCFFFF, 0x00ACFFFF, 0x0083FFFF, 0x0054FFFF, 0x0000FFFF, 0x2C00FFFF, 0x5F00FFFF, 0x9B00FFFF, 0xCB00FFFF }; дальше в public OnPlayerCommandText добавляем вот что: Code if(!strcmp(cmdtext,"/adminduty",true)) { if(PlayerInfo[playerid][pAdmin] <= 0) { SendClientMessage(playerid, 0x33CCFFAA, "Вы не админ!"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 1) { if(Hentum1[playerid] == 0) { Hentum1[playerid] = 1; ColorUpdate(playerid); SendClientMessage(playerid, 0x33CCFFAA, "* Вы включили статус админа!");
} else { KillTimer(count1[playerid]); Update3DTextLabelText(Label1[playerid], Colors[number1[playerid]], ""); Hentum1[playerid] = 0; SendClientMessage(playerid, 0x33CCFFAA, "* Вы выключили статус админа!"); } } return 1; } И вставляем в конец мода паблик к форварду который мы создали с самого начала. Code public ColorUpdate(playerid) { count1[playerid] = SetTimerEx("ColorUpdate",200,0,"i",playerid); Update3DTextLabelText(Label1[playerid], Colors[number1[playerid]], ".:Админ:."); SetPlayerColor(playerid,Colors[number1[playerid]]); number1[playerid]++; if(number1[playerid] == 25) { number1[playerid] = 1; } if(Hentum1[playerid] == 0) { KillTimer(count1[playerid]); Update3DTextLabelText(Label1[playerid], Colors[number1[playerid]], ""); } return 1; }
|