Long story short, if you don't know how to make an admin system - don't do it.
i already have one, and i already have a /setadmin command, but i want to add the function in the end, and i do not use any command include.
But i need help...
My code, i want to add another "section", i don't know what is called, but in this command, is used /daradmin id level, i want /daradmin id level string, someone help me on how to do this
Код:
if(strcmp(cmd, "/daradmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /daradmin [ id ] [level(1-10)]");
SendClientMessage(playerid, COLOR_GRAD2, "Nives de Admins");
SendClientMessage(playerid, COLOR_GRAD2, "1 = Moderador");
SendClientMessage(playerid, COLOR_GRAD2, "2 = Admin");
SendClientMessage(playerid, COLOR_GRAD2, "3 = Admin");
SendClientMessage(playerid, COLOR_GRAD2, "4 = Admin");
SendClientMessage(playerid, COLOR_GRAD2, "5 = Master");
SendClientMessage(playerid, COLOR_GRAD2, "6 = SuperMaster");
SendClientMessage(playerid, COLOR_GRAD2, "7 = SubDono");
SendClientMessage(playerid, COLOR_GRAD2, "10 = Dono");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(PlayerInfo[playerid][pAdmin] >= 10 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pAdmin] >= 10){
format(string, sizeof(string), " Vocк foi promovido para level %d de Admin - Por %s", level, Nome(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Admin[%s] Promovido a Level [%d] de Admin.", Nome(para1), level, giveplayer);
MensagemAdmin(COLOR_GRAD1,string,1);
}
PlayerInfo[para1][pAdmin] = level;
printf(":Admin: - %s foi promovido por %s a level %d de admin", Nome(para1), Nome(playerid), level);
format(string, sizeof(string), " Vocк promoveu %s Para o level %d de Admin.", Nome(para1), level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
}
}
return 1;
}