Dialog problems urghh -
Immortal99 - 17.04.2017
I'm trying to script, when I press Next admin lvl 6 should see admin lvl 5 cmds and so on, and here is my code:
PHP код:
COMMAND:acmds(playerid, params[])
{
if(playerData[playerid][playerLoggedIn])
{
if(playerData[playerid][playerLevel] == 1)
{
new string[1400];
strcat(string, "{51FF00}/goto | /aod | /kick | /jail | /asay | /spawn | /slap | /warn | /freeze | /unfreeze | /playstats\n");
strcat(string, "{51FF00}/spec | /specoff | /rarb");
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL1, DIALOG_STYLE_MSGBOX, "{98B0CD}Admin Level 1 Commands", string, "Okay", "Next");
return 1;
}
else if (playerData[playerid][playerLevel] == 2)
{
new string[1400];
strcat(string, "{51FF00}/alog | /explode | /vrespawn | /duel | /mute | /unmute | /playerweapons | /arenas | /clearchat\n");
strcat(string, "{51FF00}/blockreport | /blockask");
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL2, DIALOG_STYLE_MSGBOX, "{98B0CD}Admin Level 2 Commands", string, "Okay", "Next");
return 1;
}
else if (playerData[playerid][playerLevel] == 3)
{
new string[1400];
strcat(string, "{51FF00}/ban | /vc | /getpforevent | /unfreezeall | /setskin | /vdestroy | /get | /vgoto | /vbring | /resetweapons\n");
strcat(string, "{51FF00}/forcerules | /forcecoptutorial | /aheal | /playertokens | /playervehicles | /playerjailtime | /playerjob");
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL3, DIALOG_STYLE_MSGBOX, "{98B0CD}Admin Level 3 Commands", string, "Okay", "Next");
return 1;
}
else if (playerData[playerid][playerLevel] == 4)
{
new string[1400];
strcat(string, "{51FF00}/unban | /uncopban | /copban | /gspy | /resetskin | /getip | /countdown | /respawnalluv | /unarmyban | /armyban\n");
strcat(string, "{51FF00}/destroyallav | /announce | /ffaevent | /startffa | /destroyffa | /pmspy | /dmevent | /startdm | /glassevent\n");
strcat(string, "{51FF00}/startglass | /destroyglass | /falloutevent | /startfallout | /destroyfallout | /cvrevent | /startcvr | /lmsevent\n");
strcat(string, "{51FF00}/destroylms | /adkill | /uncuff");
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL4, DIALOG_STYLE_MSGBOX, "{98B0CD}Admin Level 4 Commands{FFFFFF}", string, "Okay", "Next");
return 1;
}
else if (playerData[playerid][playerLevel] == 5)
{
new string[1400];
strcat(string, "{51FF00}/ahealall | /cwspy | /createhouse | /deletehouse | /giveweapon | /respawnallv | /resetallweapons | /gotocase\n");
strcat(string, "{51FF00}/startcase | /houseinfo");
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL5, DIALOG_STYLE_MSGBOX, "{98B0CD}Admin Level 5 Commands{FFFFFF}", string, "Okay", "Next");
return 1;
}
else if (playerData[playerid][playerLevel] == 6)
{
new string[1400];
strcat(string, "{51FF00}/teleport | /giveallweapon | /doublexp | /motd(1-3) | /ping | /fine | /playerhouses | /standardvip | /silvervip\n");
strcat(string, "{51FF00}/goldvip | /givetoken | /givecash | /givexp | /b | /pingimmune | /set");
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL6, DIALOG_STYLE_MSGBOX, "{98B0CD}Admin Level 6 Commands{FFFFFF}", string, "Okay", "Next");
return 1;
}
return 1;
}
return 0;
}
Thanks
Re: Dialog problems urghh - Astralis - 17.04.2017
Change
pawn Код:
(playerData[playerid][playerLevel] ==
to
pawn Код:
(playerData[playerid][playerLevel] >=
Re: Dialog problems urghh -
Immortal99 - 17.04.2017
Not working, it's something to do with OnDialogResponse and I think u didn't read my problem correct
Re: Dialog problems urghh -
LazzyBoy - 17.04.2017
i think you have to create 1 string for all if you want to show it in that way , not new string like you did but not sure.
Re: Dialog problems urghh -
Immortal99 - 17.04.2017
Example: I am level 6 and I want to see level 5 commands, I just click Next, like move on to the lvl 5 dialog how do I do that?
Re: Dialog problems urghh -
LazzyBoy - 17.04.2017
Well you can make it by switching listitems for example
Showing the dialog at cmd
Код:
new string[128];
format(string,sizeof(string),"Level 1\nLevel 2\nLevel 3\nLevel 4\nLevel 5\nLevel 6");
ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_LISTITEM,"Admin Commands", string,"Okayer","Cancel");
After that at ondialogresponse
Код:
if(dialogid == yourdialogid)
{
switch(listitem)
{
case 0:
{
//admin lvl 1 cmds here
}
case 1:
{
//admin lvl 2 etc
}
}
}
Re: Dialog problems urghh -
LEOTorres - 17.04.2017
Here, do this:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_ADMIN_LEVEL6)
{
if(response == 0)
{
new string[1400];
strcat(string, "{51FF00}/ahealall | /cwspy | /createhouse | /deletehouse | /giveweapon | /respawnallv | /resetallweapons | /gotocase\n");
strcat(string, "{51FF00}/startcase | /houseinfo");
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL5, DIALOG_STYLE_MSGBOX, "{98B0CD}Admin Level 5 Commands{FFFFFF}", string, "Okay", "Next");
}
return 1;
}
if(dialogid == DIALOG_ADMIN_LEVEL5)
{
if(response == 0)
{
new string[1400];
strcat(string, "{51FF00}/unban | /uncopban | /copban | /gspy | /resetskin | /getip | /countdown | /respawnalluv | /unarmyban | /armyban\n");
strcat(string, "{51FF00}/destroyallav | /announce | /ffaevent | /startffa | /destroyffa | /pmspy | /dmevent | /startdm | /glassevent\n");
strcat(string, "{51FF00}/startglass | /destroyglass | /falloutevent | /startfallout | /destroyfallout | /cvrevent | /startcvr | /lmsevent\n");
strcat(string, "{51FF00}/destroylms | /adkill | /uncuff");
ShowPlayerDialog(playerid, DIALOG_ADMIN_LEVEL4, DIALOG_STYLE_MSGBOX, "{98B0CD}Admin Level 4 Commands{FFFFFF}", string, "Okay", "Next");
}
return 1;
}
return 0;
}
Follow this format for the rest of the levels.
Re: Dialog problems urghh -
Immortal99 - 17.04.2017
Thanks both, for your opinion. I repped both u guys
Re: Dialog problems urghh -
Immortal99 - 17.04.2017
+Rep LazzyBoy
+Rep LEOTorres