How i can change command '/makeadmin' in dialog... like: type '/makeadmin <part of name/id>' and is open an dialog_style_list whit admin levels.
i have /makeadmin...
Someone??
i have /makeadmin...
HTML Code:
CMD:makeadmin(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 6)
{
new id,adminlevel,sendername[30],giveplayer[30],string[200];
if(sscanf(params, "ui",id,adminlevel)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /makeadmin <Name/Playerid> <Admin Level>");
if(IsPlayerConnected(id))
{
if(id != INVALID_PLAYER_ID)
{
GetPlayerName(id, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[id][pAdmin] = adminlevel;
PlayerInfo[id][pChar] = 217;
SetPlayerSkin(id, 217);
printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, adminlevel);
format(string, sizeof(string), "You have been promoted to a level %d admin by %s.", adminlevel, sendername);
SendClientMessage(id, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have promoted %s to a level %d admin.", giveplayer,adminlevel);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "{f03337}Warning: Admin %s has set %s to a level %d admin.", sendername,giveplayer,adminlevel);
ABroadCast(COLOR_WHITE,string,4);
new wakaname[25];
GetPlayerName(id,wakaname,25);
new str[256];
format(str,256,"UPDATE users SET `Admin`='%d',`CChar`='%d' WHERE `name`='%s'",PlayerInfo[id][pAdmin],PlayerInfo[id][pChar],wakaname);
mysql_query(SQL,str);
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
}
}
return 1;
}
Aucun commentaire:
Enregistrer un commentaire