Raised This Month: $12 Target: $400
 3% 

[REQ] Simple plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Russiaboy
BANNED
Join Date: May 2009
Location: ZombiePlague is my Home
Old 04-18-2010 , 01:23   Re: [REQ] Simple plugin
Reply With Quote #11

Quote:
Originally Posted by Shidla View Post
NOT tested:
PHP Code:
#include <amxmodx>  
#include <amxmisc>  
#include <fun>
#include <zombieplague>  

#define SPEED 400.0 // Note: increasing this is likely to have no effect unless you alter server & clients cvars
#define RED 180
#define GREEN 240
#define BLUE 140

new bool:g_adrenaline[33]
new 
g_cweapon[33]

public 
plugin_init() 
{  
    
register_plugin("adrenaline boost""1.0""watch/Shidla")

    
register_event("HLTV" "new_round" "a" "1=0" "2=0")
    
register_event("Damage""damage_event""b""2!0")
    
register_event("CurWeapon","weapon_event","be","1=1")
    
register_event("DeathMsg""death_event""a")

    
register_cvar("amx_adrenaline","1")
    
register_cvar("amx_adrenaline_health","5")
}

// check if the player has low enough health to gain an adrenaline boost
public damage_event(id)
{
    if (!
get_cvar_num("amx_adrenaline"))
        return 
PLUGIN_CONTINUE

    
if (g_adrenaline[id])
        return 
PLUGIN_CONTINUE
    
    
if (!is_user_alive(id))
        return 
PLUGIN_CONTINUE

    
if (!zp_get_user_zombie(id))
        return 
PLUGIN_CONTINUE

    
if (get_user_health(id) <= get_cvar_num("amx_adrenaline_health")) 
    {
        
set_user_maxspeed(idSPEED)
        
set_user_rendering(idkRenderFxGlowShellREDGREENBLUEkRenderNormal0)

        
message_begin(MSG_ONEget_user_msgid("ScreenFade"), {0,0,0}, id)
        
write_short(~0)
        
write_short(~0)
        
write_short(0x0004// stay faded
        
write_byte(RED)
        
write_byte(GREEN)
        
write_byte(BLUE)
        
write_byte(100)
        
message_end()

        
client_cmd(id,"spk fvox/adrenaline_shot.wav")
        
g_adrenaline[id]=true
    
}
    return 
PLUGIN_CONTINUE
}

// remove screenfade as they are in spec now
public death_event()
{
    if (!
get_cvar_num("amx_adrenaline"))
        return 
PLUGIN_CONTINUE

    
new id read_data(2)
    if (
g_adrenaline[id])
    {
        
message_begin(MSG_ONEget_user_msgid("ScreenFade"), {0,0,0}, id)
        
write_short(1<<10)
        
write_short(1<<10)
        
write_short(0x0000// fade out
        
write_byte(RED)
        
write_byte(GREEN)
        
write_byte(BLUE)
        
write_byte(100)
        
message_end()
    }
    return 
PLUGIN_CONTINUE
}

// reset adrenaline
public new_round()
{
    if (!
get_cvar_num("amx_adrenaline"))
        return 
PLUGIN_CONTINUE

    
new players[32], numplayer
    get_players
(playersnum)
    for (new 
i=0i<numi++)
    {
        
player players[i]

        if(!
is_user_connected(player))
            continue

        if(
g_adrenaline[player])
        {
            
set_user_maxspeed(player0.0)
            
set_user_rendering(playerkRenderFxGlowShell000kRenderNormal0)
            
g_adrenaline[player] = false
        
}
    }
    return 
PLUGIN_CONTINUE
}

// ensure speed doesnt alter when they change weapon
public weapon_event(id
{
    new 
weaponid read_data(2)
    if (
g_cweapon[id] != weaponid
    {
        if (!
get_cvar_num("amx_adrenaline"))
            return 
PLUGIN_CONTINUE

        
if(g_adrenaline[id])
            {
            if(
zp_get_user_zombie(id))
                
set_user_maxspeed(idSPEED)
            else
            
message_begin(MSG_ONEget_user_msgid("ScreenFade"), {0,0,0}, id)
            
write_short(1<<10)
            
write_short(1<<10)
            
write_short(0x0000// fade out
            
write_byte(RED)
            
write_byte(GREEN)
            
write_byte(BLUE)
            
write_byte(0)
            
message_end()
            }
    }
    return 
PLUGIN_CONTINUE

can you add a model file for it?
Russiaboy is offline
Send a message via MSN to Russiaboy Send a message via Skype™ to Russiaboy
artos
Senior Member
Join Date: Mar 2010
Old 04-18-2010 , 07:41   Re: [REQ] Simple plugin
Reply With Quote #12

Quote:
Originally Posted by Russiaboy View Post
can you add a model file for it?
Check code. This plugin doesn't use any models.
artos is offline
Send a message via Skype™ to artos
Russiaboy
BANNED
Join Date: May 2009
Location: ZombiePlague is my Home
Old 04-18-2010 , 07:52   Re: [REQ] Simple plugin
Reply With Quote #13

Quote:
Originally Posted by artos View Post
Check code. This plugin doesn't use any models.
idiot read before post !
Russiaboy is offline
Send a message via MSN to Russiaboy Send a message via Skype™ to Russiaboy
artos
Senior Member
Join Date: Mar 2010
Old 04-18-2010 , 08:59   Re: [REQ] Simple plugin
Reply With Quote #14

Quote:
Originally Posted by Russiaboy View Post
idiot read before post !
Next time you consider writing a post, it is understandable for the rest of the outside of your little imaginary world.
artos is offline
Send a message via Skype™ to artos
Reply



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 08:52.


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