Preciso que esse cmd sу funcione para adm do level 5. Desde jб, agradeзo.
Код:
if(strcmp(cmd, "/desban", true) == 0)
{
new tmp[30];
tmp = strtok(cmdtext, idx);
new serialid[164];
serialid = tmp;
if(!fexist("SerialBans.txt")) return SendClientMessage(playerid, 0x6EF83CFF, "На сервере нет забаненных {FFFFFF}Serial ID");
new File:sfile = fopen("SerialBans.txt", io_readwrite);
new banstr[512], templine[1024];
while(fread(sfile, banstr)) strcat(templine, banstr);
fclose(sfile);
new index = strfind(templine, serialid);
if(index == -1) return SendClientMessage(playerid, 0x6EF83CFF, "На этом сервере данный {FFFFFF}Serial ID {6EF83C}не забанен.");
strdel(templine, index, index + SERIAL_LENGTH);
sfile = fopen("SerialBans.txt", io_write);
fwrite(sfile, templine);
fclose(sfile);
SendClientMessage(playerid, 0x6EF83CFF, "Вы разабанили серийный номер:");
new sstring[128];
format(sstring, sizeof(sstring), "{FFFFFF}%s", serialid);
SendClientMessage(playerid, -1, sstring);
return 1;
}
PHP код:
// variбvel do seu servidor, essa й sу como exemplo.
new adminlvl[MAX_PLAYERS];
// topo do comando
if(!adminlvl[playerid] == 5) return SendClientMessage(playerid, -1, "Vocк nгo й admin lvl 5");