Dialog problems urghh
#1

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(playeridparams[])
{
    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(playeridDIALOG_ADMIN_LEVEL1DIALOG_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(playeridDIALOG_ADMIN_LEVEL2DIALOG_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(playeridDIALOG_ADMIN_LEVEL3DIALOG_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(playeridDIALOG_ADMIN_LEVEL4DIALOG_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(playeridDIALOG_ADMIN_LEVEL5DIALOG_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(playeridDIALOG_ADMIN_LEVEL6DIALOG_STYLE_MSGBOX"{98B0CD}Admin Level 6 Commands{FFFFFF}"string"Okay""Next");
            return 
1;
        }
        return 
1;
    }
    return 
0;

Thanks
Reply
#2

Change
pawn Код:
(playerData[playerid][playerLevel] ==
to
pawn Код:
(playerData[playerid][playerLevel] >=
Reply
#3

Not working, it's something to do with OnDialogResponse and I think u didn't read my problem correct
Reply
#4

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.
Reply
#5

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?
Reply
#6

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 
        }
    }
}
Reply
#7

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.
Reply
#8

Thanks both, for your opinion. I repped both u guys
Reply
#9

+Rep LazzyBoy
+Rep LEOTorres
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)