AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=44)
-   -   Cola Lover VIP HELP (https://forums.alliedmods.net/showthread.php?t=271907)

Spin3 09-20-2015 09:01

Cola Lover VIP HELP
 
Good day, I would like to ask for help from the hero.
To add a hero to him that I have power only admin... ADMIN_LEVEL_G
something I tried already but it does not work

Sorry about my bad English

This is code:
Code:

// COLA LOVER! - Dr Dream's first hero! THIS IS MY FIRST HERO, SO DONT LAUGHT! :P

/* CVARS - copy and paste to shconfig.cfg

//Cola Lover
cola_level 9
cola_health 700                //Starting Health (default is 700)
cola_speed 500                //Running Speed (default is 500)

*/

/*
* v1.3 - vittu - 6/27/06
*      - renamed file from sh_cola to sh_colalover.
*      - Updated to amxmodx only.
*      - Minor code clean up.
*
* v1.2 - vittu - 6/14/05
*      - Minor code clean up.
*
*/

#include <amxmodx>
#include <amxmisc>
#include <superheromod>

// GLOBAL VARIABLES
new HeroName[] = "\r[ExtraVIP]\y Cola Lover"
new bool:HasColaLover[SH_MAXSLOTS+1] // Varible only used for power removal
new bool:ColaSelected[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------
public plugin_init()
{
        // Plugin Info
        register_plugin("SUPERHERO Cola Lover", "1.3", "Dr Dream")

        // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
        register_cvar("cola_level", "9")
        register_cvar("cola_health", "700")
        register_cvar("cola_speed", "500")

        // FIRE THE EVENT TO CREATE THIS SUPERHERO!
        shCreateHero(HeroName, "Caffeine and Sugar", "Now you run Fast and have More HP", false, "cola_level")

        // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
        // INIT
       
        register_srvcmd("cola_init", "cola_init")
        shRegHeroInit(HeroName, "cola_init")

        // Let Server know about Cola Lover's max speed
        shSetMaxSpeed(HeroName, "cola_speed", "[0]")
        shSetMaxHealth(HeroName, "cola_health")
}
//----------------------------------------------------------------------------------------------
public cola_init(id)
{
                // First Argument is an id
                new temp[6]
                read_argv(1, temp, 5)
                new id = str_to_num(temp)
       
                // 2nd Argument is 0 or 1 depending on whether the id has the hero
                read_argv(2, temp, 5)
                new hasPowers = str_to_num(temp)

                if (get_user_flags(id) & ADMIN_LEVEL_G )
                {
                       
                        shRemSpeedPower(id)
                        shRemHealthPower(id)
                       
                        HasColaLover[id] = (hasPowers!=0)
                        ColaSelected[id] = HasColaLover[id]
                }
                else {
                        client_print(id, print_chat, "[SuperHero] Hrdina %s je len pre ExtraVIP hracov.", HeroName)
                }
}

//----------------------------------------------------------------------------------------------



All times are GMT -4. The time now is 12:08.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.