Hmm, i've added this and it complies perfect,
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Admincp)
{
if(response)
switch(listitem)
{
case 0:
{
if (pInfo[playerid][Adminlevel] < 1) return 0;
for(new i;i<100;i++)
SCMToAll(-1, " ");
return 1;
}
case 1:
{
new str[300], str1[1000];
if (pInfo[playerid][Adminlevel] >= 1)
{
format(str, sizeof(str), "{FF0000}Moderator commands\n");
strcat(str1, str);
format(str, sizeof(str), "/a - Admin Chat\n");
strcat(str1, str);
format(str, sizeof(str), "/spec - Spectate a player\n");
strcat(str1, str);
format(str, sizeof(str), "/go - Teleport to a player\n");
strcat(str1, str);
format(str, sizeof(str), "/get - Teleport a player to you\n\n");
strcat(str1, str);
}
if (pInfo[playerid][Adminlevel] >= 2)
{
format(str, sizeof(str), "Administrator commands\n");
strcat(str1, str);
format(str, sizeof(str), "/sethelper - set a player helper\n");
strcat(str1, str);
format(str, sizeof(str), "/vehicle - Give a player a vehicle\n");
strcat(str1, str);
format(str, sizeof(str), "/setname - Set a players name\n");
strcat(str1, str);
format(str, sizeof(str), "/repair - Repair vehicle\n");
strcat(str1, str);
format(str, sizeof(str), "/setpremium - set a player premium\n\n");
strcat(str1, str);
}
if (pInfo[playerid][Adminlevel] >= 3)
{
format(str, sizeof(str), "Lead administrator commands\n");
strcat(str1, str);
format(str, sizeof(str), "/setadmin - set a player admin\n");
strcat(str1, str);
format(str, sizeof(str), "/restart - restart the server\n\n");
strcat(str1, str);
}
if (pInfo[playerid][Adminlevel] >= 4)
{
format(str, sizeof(str), "LeXuZ & Jakwobs commands\n");
strcat(str1, str);
format(str, sizeof(str), "/what - what the fuck\n");
strcat(str1, str);
format(str, sizeof(str), "/die - kill \n");
strcat(str1, str);
}
ShowPlayerDialog(playerid, Admincmd, DIALOG_STYLE_MSGBOX, "Admin commands", str1 ,"close","");
}
}
}
}
return 1;
}
but when i am in game it does nothing, don't show the commands nor clear the chat, but it does pop up with the admincp dialog