Sim serнa /criaradmin [ID] [NIVEL] [FUNЗГO]
mais o /admins no lugar da funзгo fica um "ESPAЗO"
criaradmin \/
if(strcmp(cmd, "/criaradmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 133
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode usar este comando!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{FFFFFF}Comando Correto » {00FFFF}/criaradmin [ID do Player] [Nнvel] [Funзгo]");
return 1;
}
new para1;
new level;
new funcao[500];
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{FFFFFF}Comando Correto » {00FFFF}/criaradmin [ID do Player] [Nнvel] [Funзгo]");
return 1;
}
level = strval(tmp);
if(level > 4000)
{
SendClientMessage(playerid, COLOR_GRAD1, " Nгo se pode criar um admin com nivel maior que 4000");
return true;
}
if(PlayerInfo[playerid][pAdmin] >= 133
{
if((level >= 6) && (level <= 1336))
{
SendClientMessage(playerid, COLOR_GRAD1, " Esse Nivel de Admin nгo existe, Use /cargosadm");
return true;
}
}
if(PlayerInfo[playerid][pAdmin] >= 133
{
if((level >= 1341) && (level < 3000))
{
SendClientMessage(playerid, COLOR_GRAD1, " Esse Nivel de Admin nгo existe, Use /cargosadm");
return true;
}
}
if(PlayerInfo[playerid][pAdmin] >= 133
{
if((level >= 3001) && (level < 4000))
{
SendClientMessage(playerid, COLOR_GRAD1, " Esse Nivel de Admin nгo existe, Use /cargosadm");
return true;
}
}
if(PlayerInfo[playerid][pAdmin] == 133
{
if(level > 2)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a criar admin maior que nivel 1 (use /cargosadm)");
return true;
}
}
if(PlayerInfo[playerid][pAdmin] == 1339)
{
if(level > 4)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a criar admin maior que nivel 3 (use /cargosadm)");
return true;
}
}
if(PlayerInfo[playerid][pAdmin] == 1340)
{
if(level > 5)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a criar admin maior que nivel 4 (use /cargosadm)");
return true;
}
}
if(PlayerInfo[playerid][pAdmin] == 3000)
{
if(level > 1337)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a criar admin maior que nivel 5 (use /cargosadm)");
return true;
}
}
if(PlayerInfo[playerid][pAdmin] == 4000)
{
if(level > 1339)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a criar admin maior que nivel MASTER 2 (use /cargosadm)");
return true;
}
}
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(level == 0)
{
format(string, sizeof(string), " Vocк retirou o admin de %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " O Admin %s retirou seu admin!", sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
PlayerInfo[para1][pAdmin] = 0;
admhide[playerid] = 1;
SetPlayerToTeamColor(playerid);
SetPlayerHealth(playerid,100);
getdate(year, month, day);
gettime(hour,minute,second);
format(string, sizeof(string), "%s retirou o admin de %s [%d/%d/%d] бs [%d:%d:%d].", sendername, giveplayer, day,
month, year, hour, minute, second);
PAdminsLog(string);
return true;
}
strmid(PlayerInfo[para1][pFuncao], funcao, 0, strlen(funcao), 256);
format(string, sizeof(string), " Vocк foi promovido a nнvel %d de admin,com a Funзгo de %s pelo admin %s", level, PlayerInfo[para1][pFuncao], sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Vocк promoveu %s para nнvel %d de Admin,com a Funзгo de %s", giveplayer, level, PlayerInfo[para1][pFuncao]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
getdate(year, month, day);
gettime(hour,minute,second);
format(string, sizeof(string), "%s deu admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d].", sendername, level, giveplayer, day,
month, year, hour, minute, second);
PlayerInfo[para1][pAdmin] = level;
FuncaoLog(string);
}
}
}
return 1;
}
admins \/
if (strcmp(cmd, "/admins", true) == 0)
{
SendClientMessage(playerid, COR_ADMIN, "Administraзгo Online:");
foreach(Player, i)
{
if(IsPlayerConnected(i) == 1 && PlayerInfo[i][pAdmin] > 0)
{
if(admhide[i] == 0)
{
GetPlayerName(i, sendername, sizeof(sendername));
new lolz[20];
if(PlayerInfo[i][pAdmin] == 1)
{
lolz = "Admin Temporarнo";
}
if(PlayerInfo[i][pAdmin] == 2)
{
lolz = "Admin Fixo";
}
if(PlayerInfo[i][pAdmin] == 3)
{
lolz = "2(Admin)";
}
if(PlayerInfo[i][pAdmin] == 4)
{
lolz = "3(Admin)";
}
if(PlayerInfo[i][pAdmin] == 5)
{
lolz = "4(Admin)";
}
if(PlayerInfo[i][pAdmin] == 1337)
{
lolz = "5(Admin)";
}
if(PlayerInfo[i][pAdmin] >= 133
{
lolz = "1338(Master)";
}
if(PlayerInfo[i][pAdmin] >= 1339)
{
lolz = "1339(Master)";
}
if(PlayerInfo[i][pAdmin] >= 1340)
{
lolz = "1340(Master)";
}
if(PlayerInfo[i][pAdmin] == 3000)
{
lolz = "3000(Maximo)";
}
if(PlayerInfo[i][pAdmin] >= 4000)
{
lolz = "4000(Sub-Dono)";
}
if(PlayerInfo[i][pAdmin] == 5000)
{
lolz = "5000(Fundador)";
}
else if(PlayerInfo[i][pAdmin] == 5000 && PlayerInfo[playerid][pSex] == 2)
{
lolz = "5000(Fundadora)";
}
if(away[i] == 0)
{
if(admtrampando[i] == 1)
{
format(string, 128, "Admin: {FFFFFF}%s {B4B5B7}Nнvel:[{FFFFFF}%d{B4B5B7}] Funзгo:[{FFFFFF}%s{B4B5B7}]\n", sendername, lolz, pFuncao);
SendClientMessage(playerid,COLOR_GRAD1,string);
}
else
{
format(string, 128, "Admin: {FFFFFF}%s {B4B5B7}Nнvel:[{FFFFFF}%d{B4B5B7}] Funзгo:[{FFFFFF}%s{B4B5B7}] {FFFFFF}[Jogando]\n", sendername, lolz, pFuncao);
SendClientMessage(playerid,COLOR_GRAD1,string);
}
}
else
{
format(string, 128, "Admin: {FFFFFF}%s {B4B5B7}Nнvel:[{FFFFFF}%d{B4B5B7}] Funзгo:[{FFFFFF}%s{B4B5B7}] {00FFFF}[AFK]\n", sendername, lolz, pFuncao);
SendClientMessage(playerid,COLOR_GRAD1,string);
strcat(gstring,string);
}
}
}
}
return true;
}