Comandos de Admin

Iniciado por Swarlog, May 13, 2025, 06:36 PM

Tema anterior - Siguiente tema

Swarlog

Información Adicional:

Aqui traigo un script con comandos de administrador, muy bien desarrollado. Estos son los comandos implementados:

Citar/admincmds ( Show all commands made by me )
/suicide ( Suicides the player + Funny messages )
/camera ( Gives a camera to the player )
/announce ( Annonces a message to all players in server )
/tele ( Teleports a player to another player )
/kick ( Kicks a player from the server )
/weapons ( Give a full pack of weapons to the player )
/adminskin ( Gives a admin skin to the player [217] )
/acredits ( Shows the credits for this system )
/armorme ( Gives full armor to the player )
/healme ( Gives full health to the player )

Código:



    #include <a_samp>
    #include <zcmd>
    #include <sscanf>
     
    /*         Admin commands
                                    by
                            Private200
                DON'T REMOVE CREDITS         */
                           
    //=======================[Colors]====================
    #define COLOR_LIGHTBLUE 0x33CCFFAA
    #define COLOR_RED 0xAA3333AA
    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_YELLOW 0xFFFF00AA
    #define COLOR_PINK 0xFF66FFAA
    #define COLOR_BLUE 0x0000BBAA
    #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_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_BLACK 0x00000000
    #define COLOR_NEUTRALGREEN 0x81CFAB00
    #define COLOR_DARKGREEN 0x12900BBF
    #define COLOR_LIGHTGREEN 0x24FF0AB9
    #define COLOR_DARKBLUE 0x300FFAAB
    #define COLOR_BLUEGREEN 0x46BBAA00
    #define COLOR_PINK 0xFF66FFAA
    #define COLOR_LIGHTBLUE 0x33CCFFAA
    #define COLOR_DARKRED 0x660000AA
    #define COLOR_ORANGE 0xFF9900AA
    #define COLOR_PURPLE 0x800080AA
    #define COLOR_GRAD1 0xB4B5B7FF
    #define COLOR_GRAD2 0xBFC0C2FF
    #define COLOR_RED1 0xFF0000AA
    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_RED 0xAA3333AA
    #define COLOR_YELLOW 0xFFFF00AA
    #define COLOR_WHITE 0xFFFFFFAA
    #define COLOR_BROWN 0x993300AA
    #define COLOR_CYAN 0x99FFFFAA
    #define COLOR_TAN 0xFFFFCCAA
    #define COLOR_PINK 0xFF66FFAA
    #define COLOR_KHAKI 0x999900AA
    #define COLOR_LIME 0x99FF00AA
    #define COLOR_SYSTEM 0xEFEFF7AA
    #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
    //=======================[End of Colors]======================
     
    public OnFilterScriptInit()
    {
            print("\n--------------------------------------");
            print(" Admin Commands by Private200");
            print("--------------------------------------\n");
            return 1;
    }
     
    public OnPlayerConnect(playerid)
    {
            return 1;
    }
     
    COMMAND:announce(playerid, params[])
    {
            if(IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_PINK,"You have to be admin in order to use this command!");
        if(IsPlayerAdmin(playerid))
            {
            GameTextForAll(params,4000,3);
            }
            return 1;
    }
    COMMAND:camera(playerid, params[])
    {
        GivePlayerWeapon(playerid, 43, 99999);
        return 1;
    }
    COMMAND:tele(playerid, params[])
    {
            // Setup local variables
            new Player1, Player2, Float:x, Float:y, Float:z, PortMsg[128], IntID, WorldID, Name[24], AdminName[24];
            if(IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_PINK,"You have to be admin in order to use this command!");
            {
                    if (IsPlayerAdmin(playerid) >= 2)
                    {
                            if (sscanf(params, "uu", Player1, Player2)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/tele <PlayerToPort> <TargetPlayer>\"");
                            else
                            {
                            // Get the name of the admin and the second player
                            GetPlayerName(playerid, AdminName, sizeof(AdminName));
                            GetPlayerName(Player2, Name, sizeof(Name));
                                                    // Get the location of the second player
                            GetPlayerPos(Player2, x, y, z);
                            IntID = GetPlayerInterior(Player2);
                            WorldID = GetPlayerVirtualWorld(Player2);
                                                    // Port the first player to player2's location
                            SetPlayerVirtualWorld(Player1, WorldID);
                            SetPlayerInterior(Player1, IntID);
                            SetPlayerPos(Player1, x, y, z + 3.0);
                                                    // Let the first player know he's been ported
                            format(PortMsg, 128, "{00FF00}You have been ported to player {FFFF00}%s{00FF00} by {FFFF00}%s", Name, AdminName);
                            SendClientMessage(Player1, 0xFFFFFFFF, PortMsg);
                            }
                     }
             }
        return 1;
    }
    COMMAND:kick(playerid, params[])
    {
        new id, reason[128];
            if(IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_PINK,"Error:You have to be admin in order to use this command!");
        else if(id==playerid)SendClientMessage(playerid,COLOR_PINK,"Error: You can not kick yourself!");
        else if(sscanf(params, "us", id, reason))SendClientMessage(playerid, COLOR_PINK, "Usage: /kick [id/name][reason]");
            else {
                new Name[MAX_PLAYER_NAME], KickMessage[128];
            new Name2[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Name, sizeof(Name));
            GetPlayerName(id, Name2, sizeof(Name2));
            format(KickMessage, sizeof(KickMessage), "%s(%d) has kicked player %s(%d). Reason: %s", Name, playerid, Name2, id);
            SendClientMessageToAll(COLOR_PINK, KickMessage);
            Kick(id);
        }
        return 1;
    }
    COMMAND:weapons(playerid, params[])
    {
            if(IsPlayerAdmin(playerid))
            {
                    GivePlayerWeapon(playerid, 4, 2);
                    GivePlayerWeapon(playerid, 24, 50000);
                    GivePlayerWeapon(playerid, 26, 50000);
                    GivePlayerWeapon(playerid, 29, 50000);
                    GivePlayerWeapon(playerid, 31, 50000);
                    GivePlayerWeapon(playerid, 36, 50000);
            }
            return 1;
    }
    COMMAND:adminskin(playerid, params[])
    {
        if(IsPlayerAdmin(playerid))
            {
                    SetPlayerSkin(playerid, 217);
            }
            return 1;
    }
    COMMAND:healme(playerid, params[])
    {
        if(IsPlayerAdmin(playerid))
            {
            if(IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_PINK,"You have to be admin in order to use this command!");
                    SetPlayerHealth(playerid, 100);
                    SendClientMessage(playerid, COLOR_PINK,"You have been healed");
            }
            return 1;
    }
    COMMAND:suicide(playerid, params[])
    {
            SetPlayerHealth(playerid, 0);
            SendClientMessage(playerid, COLOR_PINK,"You were too young to die . Rest in peace");
            SendClientMessage(playerid, COLOR_PINK,"After you killed your self , the money has been transfered to your kids . You lost 5000$ now");
            GivePlayerMoney(playerid, -5000);
        return 1;
    }
    COMMAND:armorme(playerid, params[])
    {
        if(IsPlayerAdmin(playerid))
            {
                    if(IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_PINK,"You have to be admin in order to use this command!");
                    SetPlayerArmour(playerid, 100);
                    SendClientMessage(playerid, COLOR_PINK,"You got full armour now");
            }
            return 1;
    }
    COMMAND:admincmds(playerid, params[])
    {
        ShowPlayerDialog(playerid, 800, DIALOG_STYLE_LIST, "Admin Commands:", "LVL 0: /suicide (Comites a suicide)\nLVL 0: /camera (Gives a camera to the player)\nLVL 1: /healme (Gives full heal to the player)\nLVL 1: /armorme (Gives full armour to the player)\n\nLVL 1: /announce (Announce a message to all players)\nLVL 1: /weapons (Gives full weaopon pack to the player)\nLVL 1: /adminskin (Gives admin skin to the player) ", "Okay", "Cancel");
        return 1;
    }
    COMMAND:acredits(playerid, params[])
    {
            SendClientMessage(playerid, COLOR_PINK, "Private200 -> For making them and to Server Owner for using them");
            return 1;
    }
    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(response)// They pressed the first button.
        {
        switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
            {
                    case 800:// Our dialog!
                {
                    switch(listitem)// Checking which listitem was selected
                    {
                        case 0:// The first item listed
                                    { //I left them blank , so nothing happends when someone click them
                        }
                        case 1: // The second item listed
                        { //I left them blank , so nothing happends when someone click them
                        }
                        case 2: // The third item listed
                        { //I left them blank , so nothing happends when someone click them
                        }
                        case 3: // The third item listed
                        { //I left them blank , so nothing happends when someone click them
                                    }
                        case 4: // The fourth item listed
                        { //I left them blank , so nothing happends when someone click them
                                    }
                                    case 5: // The fifht item listed
                                    { //I left them blank , so nothing happends when someone click them
                                    }
                                    case 6: // The sixth item listed
                                    { //I left them blank , so nothing happends when someone click them
                                    }
                                    case 7: // The sixth item listed
                                    {
                        }
                    }
                }
            }
        }
    return 1;
    }


--> http://pastebin.com/5bpUWX07