[Tutorial] Making CMD:AdutyOn/Off and Announce [zcmd] + Colors
#1

Hello.
This is my first tutorial, sorry for bad english and bad grammar, and i know theres more option making aduty. Like /aduty so if you're already ON it will disable it. But heres my Option.

First, you'll need Admin System, your or anyone's else, (if anyone's else, i would say, LuxAdmin is great one).

First, you will have to make First part of CMD.

pawn Код:
CMD:adutyon(playerid, params[])
{
This is first part of the CMD.
Now we'll have to make, for what level is ADUTY Avaible. Now i'm going to make LVL 1.
pawn Код:
CMD:adutyon(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not atleast Admin Level 1!"); //This will make Admin LVL 1 + Cmd. If you're not admin lvl 1, you will get the Message.
Now, if you're admin level 1 atleast, you will pass that Return Message, after the Reutrn message, make what you want, like SetPlayerHealth(playerid, 500000);, i'll show one example of what i did.

pawn Код:
CMD:adutyon(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not atleast Admin Level 1!"); //This will make Admin LVL 1 + Cmd. If you're not admin lvl 1, you will get the Message.
    SetPlayerHealth(playerid, 999999); //Setting player's max Health to UNLIMITED
    GivePlayerWeapon(playerid, 38, 999999); //Giving a Minigun to the player
    SendClientMessage(playerid, COLOR_ORANGE, "Adminstrator is now On Duty! {FFFFFF} Ask for Assistance if you need!");
   return 1;
}
You can make more things, like spawning him a car, giving all players 50 money, making hackers kicked, sending all players a message like i did.
-----------------------------
Now lets make Adutyoff Command.
We'll do all over agian, just with new things, Reseting player's hp to 100, and reseting all weapons.
pawn Код:
CMD:adutyoff(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not atleast Admin Level 1!");
    SetPlayerHealth(playerid, 100);
    ResetPlayerWeapons(playerid);
    SendClientMessageToAll(COLOR_YELLOW, "Adminstrator is now Off Duty! {FFFFFF}Leave him to Roleplay!");
    return 1;
}

-Now we'll make Announce Command.

pawn Код:
CMD:announce(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not atleast Admin Level 3!"); //Making Return Message if you're not Admin LeveL 3.
    new text[60]; //Making new text.
    if(sscanf(params,"s[60]",text))
    return SendClientMessage(playerid, COLOR_RED, "USAGE: /announce [text]"); //If you only type /announce this will happen.
    GameTextForAll(text,3000,3); //This will show Game Text to all Players.
    return 1;
}

In This CMD, i used Colors, i'll post them here if you want a collection of my colors.

pawn Код:
#define COLOR_RED   0xAA3333AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_GREY  0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
#define COLOR_GREENISHGOLD 0xCCFFDD56
#define COLOR_LIGHTBLUEGREEN 0x0FFDD349
#define COLOR_NEUTRALBLUE 0xABCDEF01
#define COLOR_LIGHTCYAN 0xAAFFCC33
#define COLOR_LEMON 0xDDDD2357
#define COLOR_MEDIUMBLUE 0x63AFF00A
#define COLOR_NEUTRAL 0xABCDEF97
#define COLOR_BLUE 0x0000BBAA
#define COLOR_PURPLE 0x800080AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_VIOLET 0x9955DEEE
#define COLOR_LIGHTRED 0xFF99AADD
#define COLOR_SEAGREEN 0x00EEADDF
#define COLOR_GRAYWHITE 0xEEEEFFC4
#define COLOR_GRAD2     0xBFC0C2FF
#define COLOR_GRAD4     0xD8D8D8FF
#define COLOR_GRAD6     0xF0F0F0FF
#define COLOR_GRAD2     0xBFC0C2FF
#define COLOR_GRAD3     0xCBCCCEFF
#define COLOR_GRAD5     0xE3E3E3FF
#define COLOR_GRAD1     0xB4B5B7FF
#define COLOR_GRAD2     0xBFC0C2FF
#define COLOR_GRAD1     0xB4B5B7FF
#define COLOR_GRAD2     0xBFC0C2FF
#define COLOR_GREY      0xAFAFAFAA
#define COLOR_GRAD3     0xCBCCCEFF
#define COLOR_GRAD4     0xD8D8D8FF
#define COLOR_FADE      0xC8C8C8C8
#define COLOR_FADE2     0xC8C8C8C8
#define COLOR_FADE3     0xAAAAAAAA
#define COLOR_FADE5     0xAAAAAAAA
#define COLOR_FADE4     0x8C8C8C8C
#define COLOR_YELLOW    0xDABB3E00
#define COLOR_GRAD5     0xE3E3E3FF
#define COLOR_FADE1     0xE6E6E6E6
#define COLOR_GRAD6     0xF0F0F0FF
Thanks for viewing it!
I Know i'm not good at explaining or even at typing something, becuse i have Bad grammar.
Sorry Again!
Thanks for viewing it again!
Reply
#2

I've added to this script. When you go on Admin Duty it now changes your name to an admin name set in the user file.

I want to add a command that sets a new admin name so that it can be changed at any time.

Also, when you first register, the admin name is blank, so it needs to check if the AdminName has a value before it changes to it. I have another variable called NormalName which is set on player registration and never changes, it will put the players name back to this when they go off-duty.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)