Raised This Month: $ Target: $400
 0% 

[REQ] Simple plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
artos
Senior Member
Join Date: Mar 2010
Old 04-02-2010 , 08:56   [REQ] Simple plugin
Reply With Quote #1

Hi!

I need a simple plugin. When someone becomes zombie his screen will be red (or defined by cvar in RGB pallete) until the next round or to use an antidote.

You can took code from this:

PHP Code:
#include <amxmodx>  
#include <amxmisc>  
#include <fun>  

#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")

    
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 (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]) 
            
set_user_maxspeed(idSPEED)
    }
    return 
PLUGIN_CONTINUE

Thanks in advance for help.
artos is offline
Send a message via Skype™ to artos
artos
Senior Member
Join Date: Mar 2010
Old 04-03-2010 , 09:54   Re: [REQ] Simple plugin
Reply With Quote #2

No one can help?
artos is offline
Send a message via Skype™ to artos
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 04-03-2010 , 10:46   Re: [REQ] Simple plugin
Reply With Quote #3

When someone becomes the zombie by SOMEONE ELSE, then should his screen remain faded..?
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
artos
Senior Member
Join Date: Mar 2010
Old 04-03-2010 , 11:14   Re: [REQ] Simple plugin
Reply With Quote #4

Yes. If a player is infected, his screen goes into the red.
artos is offline
Send a message via Skype™ to artos
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 04-03-2010 , 13:15   Re: [REQ] Simple plugin
Reply With Quote #5

So just set the zombie nightvision to RED....!
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Russiaboy
BANNED
Join Date: May 2009
Location: ZombiePlague is my Home
Old 04-03-2010 , 13:21   Re: [REQ] Simple plugin
Reply With Quote #6

Quote:
Originally Posted by abdul-rehman View Post
So just set the zombie nightvision to RED....!
lol?

__
Come online skype and look at your PN ;)
Russiaboy is offline
Send a message via MSN to Russiaboy Send a message via Skype™ to Russiaboy
Dr.eNd
Member
Join Date: May 2009
Location: Saudi Arabia
Old 04-03-2010 , 13:49   Re: [REQ] Simple plugin
Reply With Quote #7

I think he want to make a diffrent nightvision with a deffrent Color that Human Can chose it
Dr.eNd is offline
Shidla
Senior Member
Join Date: Nov 2008
Location: Russia, Moscow
Old 04-03-2010 , 14:46   Re: [REQ] Simple plugin
Reply With Quote #8

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

__________________
[Russian Federation] NOT USSR
This is madness?! This is Shidla!
[ZP] Laser Mine 2.8.2 ML (NEW !!2013!!) | [ZP] New Win Msg 1.4
| [ZP] MutaDote 1.1

Last edited by Shidla; 04-03-2010 at 14:49.
Shidla is offline
Send a message via ICQ to Shidla Send a message via Skype™ to Shidla
artos
Senior Member
Join Date: Mar 2010
Old 04-03-2010 , 20:40   Re: [REQ] Simple plugin
Reply With Quote #9

Thanks, it works but can you remove health check?

Already removed glow and speed but when i remove health check, my server crashes.

PHP Code:
#include <amxmodx>  
#include <amxmisc>  
#include <fun>
#include <zombieplague>  

#define RED 100
#define GREEN 0
#define BLUE 0

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","99999")
}

// 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")) 
    {
        
        
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/biohazard_detected.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))
                
            
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

artos is offline
Send a message via Skype™ to artos
artos
Senior Member
Join Date: Mar 2010
Old 04-17-2010 , 12:47   Re: [REQ] Simple plugin
Reply With Quote #10

Refresh!

I really need it.
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 22:24.


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