12.07.2017, 16:43
List of admin commands
Log in rcon ( /rcon login [password] )
- Pictures
- Script
PHP код:
enum EnumAdminCommands {command[45],information[80]};
new const AdminCommands[][EnumAdminCommands] = //{"command","information"}
{
{"/Admincmd","List of commands for admin"},
{"/Example","This command does not exist!"},
{"/Example2","..."}
};
CMD:admincmd(playerid) //using include izcmd
{
if(!IsPlayerAdmin(playerid)) //change
return 0;
new ss[50],s[500];
for(new i; i < sizeof(AdminCommands); i++)
{
format(ss, 50, "%s\n", AdminCommands[i][command]);
strcat(s, ss);
}
ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "Admin Commands", s, "more", "close");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[ ])
{
if(dialogid == 888)
{
if(!response)
return 0;
new s[80];
for(new i; i < sizeof(AdminCommands); i++)
if(listitem == i) format(s, 80, "%s", AdminCommands[i][information]);
return ShowPlayerDialog(playerid, 889, DIALOG_STYLE_MSGBOX, "Admin Commands", s,"close","");
}
return 0;
}
Sorry for my english and if I posted on the wrong topic.