dialog script addition
#1

Hey all
i have the script i have been modifying slowly that a mate gave me its just it i was to add a admin section to it EG
this is my current script
Код:
command(help, playerid, params[])
{
	#pragma unused params
	if(Player[playerid][InBusiness] >= 1)
	{
		ShowPlayerDialog(playerid, 3260, DIALOG_STYLE_LIST, "Help Menu", "Commands\nAdministrators\nRules\nFrequently Asked Questions\nCommands For This Business", "Select", "Cancel");
	}
	else
	{
		ShowPlayerDialog(playerid, 3260, DIALOG_STYLE_LIST, "Help Menu", "Commands\nAdministrators\nRules\nFrequently Asked Questions\n", "Select", "Cancel");
	}
	return 1;
}
but if i was to add an admin version would i just add
Код:
ommand(help, playerid, params[])
{
	#pragma unused params
	if(Player[playerid][InBusiness] >= 1)
	{
		ShowPlayerDialog(playerid, 3260, DIALOG_STYLE_LIST, "Help Menu", "Commands\nAdministrators\nRules\nFrequently Asked Questions\nCommands For This Business", "Select", "Cancel");
	}
	else
	{
		ShowPlayerDialog(playerid, 3260, DIALOG_STYLE_LIST, "Help Menu", "Commands\nAdministrators\nRules\nFrequently Asked Questions\n", "Select", "Cancel");
	}
(25085)	else
	{
		if(Player[playerid][AdminLevel] >= 1)
		{
			ShowPlayerDialog(playerid, 3260, DIALOG_STYLE_LIST, "Help Menu", "Commands\nAdmin Team\nRules\nFrequently Asked Questions\nAdmin Commands", "Select", "Cancel");
		}
	}
	return 1;
}
this gives me ONE error saying
Код:
(25085) : error 029: invalid expression, assumed zero
line(25085)consists of " 	else"
Reply
#2

Try this.

pawn Код:
command(help, playerid, params[])
{
    #pragma unused params
    if(Player[playerid][InBusiness] >= 1)
    {
        ShowPlayerDialog(playerid, 3260, DIALOG_STYLE_LIST, "Help Menu", "Commands\nAdministrators\nRules\nFrequently Asked Questions\nCommands For This Business", "Select", "Cancel");
    }
    if(Player[playerid][AdminLevel] >= 1)
    {
        ShowPlayerDialog(playerid, 3260, DIALOG_STYLE_LIST, "Help Menu", "Commands\nAdmin Team\nRules\nFrequently Asked Questions\nAdmin Commands", "Select", "Cancel");
    }
    else
    {
        ShowPlayerDialog(playerid, 3260, DIALOG_STYLE_LIST, "Help Menu", "Commands\nAdministrators\nRules\nFrequently Asked Questions\n", "Select", "Cancel");
    }
    return 1;
}
And btw, you shouldn't use the same dialog id for more then one dialog. Each dialog should have their own set id.
Reply
#3

Awesome thanks
Reply
#4

will that show for all the admins from level 1 to level 999999999 ?
Reply
#5

It will.

if(Player[playerid][AdminLevel] >= 1) //the arrow followed by the equals sign means 'above or equal to'.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)