dialog script addition - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: dialog script addition (
/showthread.php?tid=212810)
dialog script addition -
Deal-or-die - 18.01.2011
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"
Re: dialog script addition -
Prumpuz - 18.01.2011
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.
Re: dialog script addition -
Deal-or-die - 18.01.2011
Awesome thanks
Re: dialog script addition -
Deal-or-die - 18.01.2011
will that show for all the admins from level 1 to level 999999999 ?
Re: dialog script addition -
Infamous - 18.01.2011
It will.
if(Player[playerid][AdminLevel] >= 1) //the arrow followed by the equals sign means 'above or equal to'.