28/09/2022 18:26
Código PHP:
new Text3D:text[MAX_PLAYERS];
enum admnivel{
id_admin,
nome_admin[13]
}
new chamaadm[][admnivel] = {
{0,"Nenhum"},
{1,"Estagiário"},
{2,"Ajudante"},
{3,"Moderador"},
{4,"Adminstrador"},
{5,"Gestor"}
}
CMD:setadmin(playerid,params[])
{
new id,valor,string[100];
if(IsPlayerAdmin(playerid))
{
if(sscanf(params,"ii",id,valor)) return SendClientMessage(playerid,0xFF0000FF,"| Admin |Utilize /daradmin id level(0-5)");
{
if(IsPlayerConnected(id))
{
pinfo[id] [admin] = valor;
if(pinfo[id] [admin] > 0){
new teste[200];
format(teste, sizeof(teste), "%s" chamaadm[valor][nome_admin]);
text[id] = Create3DTextLabel(teste, 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(text[id], id, 0.0, 0.0, 0.7);
}
}
}
}
else SendClientMessage(playerid,0xFF0000FF,"[>>]Erro");
return 1;
}