Raised This Month: $ Target: $400
 0% 

Aura Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SomeBastard
Junior Member
Join Date: Oct 2011
Old 12-23-2011 , 11:52   Aura Help
Reply With Quote #1

How to change the radius of the aura ?

Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

new g_maxplayers
new cvar_aura_enable

public plugin_init()
{
    register_plugin("[ZP] Sub-Plugin: Human Aura", "1.0", "93()|29!/<")
    
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
    
    register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
    RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
    
    g_maxplayers = get_maxplayers()
}

public plugin_precache()
{
    cvar_aura_enable = register_cvar("hunter_aura", "1")
}

// Player infected forward
public zp_user_infected_post(id, infector, nemesis)
{
    // Remove aura when getting infected
    set_pev(id, pev_effects, pev(id, pev_effects) &~ EF_BRIGHTLIGHT)
}

// Player humanized forward
public zp_user_humanized_post(id, survivor)
{
    // Plugin not enabled
    if (!get_pcvar_num(cvar_aura_enable))
    {
        // Bug fix
        set_pev(id, pev_effects, pev(id, pev_effects) &~ EF_BRIGHTLIGHT)
        
        return;
    }
    
    // Aura for Survivors is allready handled by the ZP main plugin
    if (cs_get_user_team(id) == CS_TEAM_T)
        return;
    
    set_pev(id, pev_effects, pev(id, pev_effects) | EF_BRIGHTLIGHT)
}

// Event Round Start
public event_round_start()
{
    static id
    
    for (id = 1; id <= g_maxplayers; id++)
    {
        // Plugin disabled
        if (!get_pcvar_num(cvar_aura_enable) && cs_get_user_team(id) == CS_TEAM_CT)
        {
            // Bug fix
            set_pev(id, pev_effects, pev(id, pev_effects) &~ EF_BRIGHTLIGHT)
            
            return;
        }
        
        // Nemesis/Zombie/Survivor/Dead
        if (!is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
            return;
        
        // Turn the lights on
        set_pev(id, pev_effects, pev(id, pev_effects) | EF_BRIGHTLIGHT)
    }
}

// Ham Player Spawn Post Forward
public fw_PlayerSpawn_Post(id)
if(cs_get_user_team(id) == CS_TEAM_CT)
{
    // Nemesis/Zombie/Survivor
    if (!is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
        return;
    
    set_pev(id, pev_effects, pev(id, pev_effects) | EF_BRIGHTLIGHT)
}

// Ham Player Killed Forward
public fw_PlayerKilled(id)
{
    // Nemesis/Zombie/Survivor
    if (cs_get_user_team(id) == CS_TEAM_T)
        return;
    
    // Time to go to sleep
    set_pev(id, pev_effects, pev(id, pev_effects) &~ EF_BRIGHTLIGHT)
}

// Forward Player PreThink
public fw_PlayerPreThink(id)
{
    // Plugin disabled
    if (get_pcvar_num(cvar_aura_enable))
        return;
    
    set_pev(id, pev_effects, pev(id, pev_effects) &~ EF_BRIGHTLIGHT)
}
SomeBastard is offline
Send a message via MSN to SomeBastard
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:55.


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