How can i create admin command dialog using my script enum -
SpikY_ - 02.08.2014
I was creating admin commands dialog [ DIALOG_STYLE_LIST ], but unfortunetly its give me alot of errors .. i can't make so i request anyone can make /acmds command please ,
Make tht admin commands like :
/acmds --> show them item of DIALOG_STYLE_LIST
1 Item: Moderator [lvl 1]
2 Item: Administrator [lvl 2]
3 Item: Head-Administrator [lvl 3]
4 Item: Server-Owner [lvl 4].
After tht if dialog item 1/2/3/4 response
so Show them commands in DIALOG_STYLE_MSGBOX
i will add commands by myself
and make like : Normal player can't see the commands when they type /acmds so show them msg "you are not authorized to use these cmds"
and lvl 1 can't see lvl 2/3/4 cmds
lvl 2 can't see lvl 3/4 cmds
lvl 3 can't see lvl 4 cmds
EXAMPLE:
Код:
if (PlayerInfo[playerid][Admin] < 1/2/3/4) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You are not authorized to use this command!" );
See the enum:
Код:
enum pInfo
{
Password[129],
// RegID,
Admin,
VIP,
AltName[26],
RegOn[20],
Cash,
Score,
Spawned,
LoginFail,
LoggedIn,
Goto,
isAFK,
inDM,
inMini,
inDMZone,
Float:POS_X,
Float:POS_Y,
Float:POS_Z,
Skin,
Color,
WeaponSet,
DisablePMs,
Muted,
Kills,
Deaths,
Hours,
Minutes,
BanExpire,
GodEnabled,
Helmet,
pSpawnVehicle,
BanReason[32],
BanPerm,
BanAdmin[26]
}
Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
please make this small cmd script for me
it will be great
+1 Rep for replying
Re: How can i create admin command dialog using my script enum -
Stinged - 02.08.2014
pawn Код:
#define DIALOG_ACMDS 9995
#define DIALOG_ACMDS1 9996
#define DIALOG_ACMDS2 9997
#define DIALOG_ACMDS3 9998
#define DIALOG_ACMDS4 9999
CMD:acmds(playerid, params[])
{
if (PlayerInfo[playerid][Admin] < 1)
return SendClientMessage(playerid, 0xFF0000FF, "You are not allowed to use this command.");
ShowPlayerDialog(playerid, DIALOG_ACMDS, DIALOG_STYLE_LIST, "Admin Commands", "Moderator [Level 1]\nAdministrator [Level 2]\nHead Administrator [Level 3]\nServer Owner [Level 5]", "Show", "Exit");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == DIALOG_ACMDS)
{
if (response)
{
switch (listitem)
{
case 0:
{
ShowPlayerDialog(playerid, DIALOG_ACMDS1, DIALOG_STYLE_MSGBOX, "Level 1 Commands", "ADD YOUR COMMANDS HERE", "Done", "");
}
case 1:
{
if (PlayerInfo[playerid][Admin] < 2)
return SendClientMessage(playerid, 0xFF0000FF, "You are not allowed to see these commands.");
ShowPlayerDialog(playerid, DIALOG_ACMDS2, DIALOG_STYLE_MSGBOX, "Level 2 Commands", "ADD YOUR COMMANDS HERE", "Done", "");
}
case 2:
{
if (PlayerInfo[playerid][Admin] < 3)
return SendClientMessage(playerid, 0xFF0000FF, "You are not allowed to see these commands.");
ShowPlayerDialog(playerid, DIALOG_ACMDS3, DIALOG_STYLE_MSGBOX, "Level 3 Commands", "ADD YOUR COMMANDS HERE", "Done", "");
}
case 3:
{
if (PlayerInfo[playerid][Admin] < 4)
return SendClientMessage(playerid, 0xFF0000FF, "You are not allowed to see these commands.");
ShowPlayerDialog(playerid, DIALOG_ACMDS4, DIALOG_STYLE_MSGBOX, "Level 4 Commands", "ADD YOUR COMMANDS HERE", "Done", "");
}
}
return 1;
}
}
return 1;
}
Re: How can i create admin command dialog using my script enum -
McBan - 02.08.2014
Oops, I was too slow but here you go:
Код:
#define DIALOG_ACOMMAND 5
#define DIALOG_LEVEL1 6
#define DIALOG_LEVEL2 7
#define DIALOG_LEVEL3 8
#define DIALOG_LEVEL4 9
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/acmds", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid, DIALOG_ACOMMAND, DIALOG_STYLE_LIST, "Admin Commands", "Moderator[Lvl 1]\nAdministrator[Lvl 2]\nHead-Administrator[Lvl 3]\nServer Owner[Lvl 4]", "Confirm", "Cancel");
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000, "> Error, You Must Be An Administrator To Use This Command.");
}
}
return 0;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_ACOMMAND)
{
if(!response)
{
return 1;
}
else if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, DIALOG_LEVEL1, DIALOG_STYLE_MSGBOX, "Level 1", "changeme", "Confirm", "Cancel");
return 1;
}
case 1:
{
ShowPlayerDialog(playerid, DIALOG_LEVEL2, DIALOG_STYLE_MSGBOX, "Level 2", "changeme", "Confirm", "Cancel");
return 1;
}
case 2:
{
ShowPlayerDialog(playerid, DIALOG_LEVEL3, DIALOG_STYLE_MSGBOX, "Level 3", "changeme", "Confirm", "Cancel");
return 1;
}
case 3:
{
ShowPlayerDialog(playerid, DIALOG_LEVEL4, DIALOG_STYLE_MSGBOX, "Level 4", "changeme", "Confirm", "Cancel");
return 1;
}
}
}
}
return 1;
}
Re: How can i create admin command dialog using my script enum -
SpikY_ - 02.08.2014
Stinged Bro , still there is a problem see this pic .. i login as rcon then i make myself admin level 4 .. and when i type /acmds so it shows me this "you are not allow to use this command"
Re: How can i create admin command dialog using my script enum -
SpikY_ - 02.08.2014
Stinged plz reply me fast as you can plz
Re: How can i create admin command dialog using my script enum -
SpikY_ - 02.08.2014
Help me plz .. i'm wating for replys
Re: How can i create admin command dialog using my script enum -
Stinged - 03.08.2014
Sorry for not replying, my internet wasn't working.
Are you able to check level 3 commands?
Re: How can i create admin command dialog using my script enum -
SpikY_ - 03.08.2014
no i can't .. its not working
"you are not allowed to use this command"
Re: How can i create admin command dialog using my script enum -
IceBilizard - 03.08.2014
try this
pawn Код:
CMD:acmds(playerid, params[])
{
if (PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid, 0xFF0000FF, "You are not allowed to use this command.");
ShowPlayerDialog(playerid, DIALOG_ACMDS, DIALOG_STYLE_LIST, "Admin Commands", "Moderator [Level 1]\nAdministrator [Level 2]\nHead Administrator [Level 3]\nServer Owner [Level 5]", "Show", "Exit");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == DIALOG_ACMDS)
{
if (response)
{
switch (listitem)
{
case 0:
{
ShowPlayerDialog(playerid, DIALOG_ACMDS1, DIALOG_STYLE_MSGBOX, "Level 1 Commands", "ADD YOUR COMMANDS HERE", "Done", "");
}
case 1:
{
if (PlayerInfo[playerid][Admin] >= 2)
{
ShowPlayerDialog(playerid, DIALOG_ACMDS2, DIALOG_STYLE_MSGBOX, "Level 2 Commands", "ADD YOUR COMMANDS HERE", "Done", "");
}
else return SendClientMessage(playerid, 0xFF0000FF, "You are not allowed to see these commands.");
}
case 2:
{
if (PlayerInfo[playerid][Admin] >= 3)
{
ShowPlayerDialog(playerid, DIALOG_ACMDS3, DIALOG_STYLE_MSGBOX, "Level 3 Commands", "ADD YOUR COMMANDS HERE", "Done", "");
}
else return SendClientMessage(playerid, 0xFF0000FF, "You are not allowed to see these commands.");
}
case 3:
{
if (PlayerInfo[playerid][Admin] >= 4)
{
ShowPlayerDialog(playerid, DIALOG_ACMDS4, DIALOG_STYLE_MSGBOX, "Level 4 Commands", "ADD YOUR COMMANDS HERE", "Done", "");
}
else return SendClientMessage(playerid, 0xFF0000FF, "You are not allowed to see these commands.");
}
}
return 1;
}
}
return 1;
}
Re: How can i create admin command dialog using my script enum -
Stinged - 03.08.2014
IceBilizard, if he uses that code, level 2/3/4 admins can't check level 1/2/3 commands