Moderator (Level 1): /ban /slap /kick /warn /mute /unmute /jail /unjail /mutelist /announce /spec /specoff /asay /ip Administrator (Level 2): /tempban /unban /clearchat /cweapons /worldtime /gotoxyz /lastlog (+All level 1 commands) Head Administrator (Level 3): /setlevel /setvip /removevip /setexp /resetgod (+All level 1 & 2 commands) (Head admins cannot set anyone server owner) Server Owner (Level 4): /setlevelviarcon /kickall /toglostaccmsg /saveallstats /togstuntbonus (+All level 1, 2 & 3 commands)
Example: "/lol" Text output in chat: a light blue text of "Man that was so funny I laughed out loud!"
case 1: { PlayerInfo[giveid][Admin] = 1; format(str, sizeof(str), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been set to: Moderator", (GetPlayerColor(giveid) >>> 8), GetName( giveid ), giveid ); SendClientMessageToAll( 0xB0C4DEFF, str ); return 1; } case 2: { PlayerInfo[giveid][Admin] = 2; format(str, sizeof(str), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been set to: Administrator", (GetPlayerColor(giveid) >>> 8), GetName( giveid ), giveid ); SendClientMessageToAll( 0xB0C4DEFF, str ); return 1; } case 3: { PlayerInfo[giveid][Admin] = 3; format(str, sizeof(str), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been set to: Head Administrator", (GetPlayerColor(giveid) >>> 8), GetName( giveid ), giveid ); SendClientMessageToAll( 0xB0C4DEFF, str ); return 1; } case 4: { PlayerInfo[giveid][Admin] = 4; format(str, sizeof(str), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been set to: Server Owner", (GetPlayerColor(giveid) >>> 8), GetName( giveid ), giveid ); SendClientMessageToAll( 0xB0C4DEFF, str ); return 1;
CMD:help(playerid, params[])
{
new string[125]; // change this to suit your needs.
strcat(string, "Line 1\n", sizeof(string));
strcat(string, "Line 2\n", sizeof(string));
ShowDialogForPlayer(playerid, -1, DIALOG_STYLE_MSGBOX, "Messagebox Title", string, "", "");
return 1;
}
Use strcat, and ShowDialogForPlayer.
Example: pawn Код:
|
Thanks, but I' confused here. I need to make the admin commands list only for levels 1 to 4, how do I do that?
And also, could you be a bit more specific on SendClientMessage? Sorry for being an ultra n00b. Thanks! |
CMD:help(playerid, params[])
{
new string[125]; // change this to suit your needs.
if(PlayerInfo[giveid][Admin] > 0) strcat(string, "Level 1 admin help: blabla\n", sizeof(string)); // If the person is a level 1 admin, add the help for that level
if(PlayerInfo[giveid][Admin] > 1) strcat(string, "Level 2 admin help: blabla\n", sizeof(string)); // If the person is a level 2 admin, add the help for that level
ShowDialogForPlayer(playerid, -1, DIALOG_STYLE_MSGBOX, "Messagebox Title", string, "", "");
return 1;
}