Raised This Month: $ Target: $400
 0% 

GHW_Chronics Adrenaline Mod fix


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
drumzplaya13
Senior Member
Join Date: Feb 2008
Location: TEXAS
Old 10-19-2009 , 02:33   GHW_Chronics Adrenaline Mod fix
Reply With Quote #1

Hey I need help fixing this mod. I found a slight error in this plugin which should have been fixed when it was made but everyone failed to notice it. Once adrenaline is at its peak (100), you are able to use it on special items. One of the items is Speed. Your adrenaline goes down as you use the speed, but once your adrenaline reaches "0" it is suppose to go back to the regular default speed of the server, it doesnt, you still have speed until you are killed or round ends. Can someone please edit this plugin for me so it follows what I said? I know nothing about scripting so with someone who knows how to edit it for me, that would be awesome and I would be grateful! (GHW_Chronic has been inactive for 3 weeks so I figured I would ask the community on this one)

here is the code:
Code:
/*
*   _______     _      _  __          __
*  | _____/    | |    | | \ \   __   / /
*  | |         | |    | |  | | /  \ | |
*  | |         | |____| |  | |/ __ \| |
*  | |   ___   | ______ |  |   /  \   |
*  | |  |_  |  | |    | |  |  /    \  |
*  | |    | |  | |    | |  | |      | |
*  | |____| |  | |    | |  | |      | |
*  |_______/   |_|    |_|  \_/      \_/
*
*
*
*  Last Edited: 12-30-07
*
*  ============
*   Changelog:
*  ============
*
*  v2.0
*    -Added ML
*    -Optimized Code
*
*  v1.0
*    -Initial Release
*
*/

#define VERSION    "2.0"

#include <amxmodx>
#include <amxmisc>
#include <fun>

new adrenaline_multiplier
new adrenaline_max
new adrenaline_toggle
new adrenaline_speed
new adrenaline_sound1
new adrenaline_sound2

new maxspeed_pcvar

new bool:playsound1
new bool:playsound2

new sound1[64] = "adrenaline_booster.wav"
new sound2[64] = "adrenaline_full.wav"
new sound1b[64] = "sound/adrenaline_booster.wav"
new sound2b[64] = "sound/adrenaline_full.wav"

new adrenaline[33]
new ability[33]
new alpha[33]

new bool:restarting
new bool:freezetime

public plugin_init()
{
    register_plugin("Adrenaline Mod",VERSION,"GHW_Chronic")

    adrenaline_multiplier = register_cvar("adrenaline_amount","20")
    adrenaline_max = register_cvar("adrenaline_max","100")
    adrenaline_toggle = register_cvar("adrenaline_toggle","1")
    adrenaline_speed = register_cvar("adrenaline_speed","650.0")
    maxspeed_pcvar = get_cvar_pointer("sv_maxspeed")

    register_clcmd("say /booster","menu_cmd")

    register_event("CurWeapon","CurWeapon","be")
    register_event("DeathMsg","DeathMsg","a")

    new name[32]
    get_modname(name,31)
    if(equali(name,"cstrike") || equali(name,"czero"))
    {
        register_logevent("game_restart2",2,"1=Round_Start")
        register_logevent("game_end",2,"1=Round_End")
    }
    register_event("TextMsg","game_restart1","a","2=#Game_will_restart_in")
    register_event("TextMsg","game_restart1","a","2=#Game_Commencing")

    register_menu("adrenaline_menu",(1<<0)|(1<<1)|(1<<2)|(1<<9),"menu_press")

    register_dictionary("GHW_Adrenaline_Mod.txt")
}

public game_end()
{
    new players[32], num
    get_players(players,num,"h")
    for(new i=0;i<num;i++)
    {
        ability[players[i]]=0
        set_user_rendering(players[i])
    }
    freezetime=true
}

public game_restart1()
{
    restarting = true
    new players[32], num
    get_players(players,num,"h")
    for(new i=0;i<num;i++)
    {
        adrenaline[players[i]]=0
        ability[players[i]]=0
        set_user_rendering(players[i])
    }
}

public game_restart2()
{
    if(restarting && get_pcvar_num(adrenaline_toggle))
    {
        restarting=false
        new players[32], num
        get_players(players,num,"h")
        for(new i=0;i<num;i++)
        {
            adrenaline[players[i]]=0
            ability[players[i]]=0
            set_user_rendering(players[i])
        }
    }
    freezetime=false
}

public plugin_precache()
{
    adrenaline_sound1 = register_cvar("adrenaline_sound1","1")
    adrenaline_sound2 = register_cvar("adrenaline_sound2","1")
    if(get_pcvar_num(adrenaline_sound1) && file_exists(sound1b))
    {
        playsound1=true
        precache_sound(sound1)
    }
    if(get_pcvar_num(adrenaline_sound2) && file_exists(sound2b))
    {
        playsound2=true
        precache_sound(sound2)
    }
}

public DeathMsg()
{
    if(get_pcvar_num(adrenaline_toggle) && !restarting)
    {
        new id = read_data(1)
        new target = read_data(2)
        ability[target]=0
        set_user_rendering(target)
        if(get_user_team(id)==get_user_team(target))
        {
            adrenaline[id] -= get_pcvar_num(adrenaline_multiplier)
            if(adrenaline[id]<0) adrenaline[id]=0
        }
        else
        {
            new maxad = get_pcvar_num(adrenaline_max)
            if(adrenaline[id]!=maxad)
            {
                adrenaline[id] += get_pcvar_num(adrenaline_multiplier)
                if(adrenaline[id]>=maxad)
                {
                    adrenaline[id]=maxad
                    if(playsound2) emit_sound(id,CHAN_VOICE,sound2,VOL_NORM,ATTN_NORM,0,PITCH_NORM)
                    client_print(id,print_chat,"[AMXX] %L",id,"MSG_HOWTO")
                }
            }
        }
    }
}

public client_connect(id)
{
    adrenaline[id]=0
    ability[id]=0
    alpha[id]=0
    set_task(0.5,"adrenaline_hud",id,"",0,"b")
}

public client_disconnect(id) remove_task(id)

public adrenaline_hud(id)
{
    if(get_pcvar_num(adrenaline_toggle) && is_user_alive(id))
    {
        if(ability[id])
        {
            if(adrenaline[id]<=0)
            {
                ability[id]=0
                set_user_rendering(id)
            }
            else adrenaline[id] -= 2
        }

        if(ability[id]==2 && get_user_health(id)<254) set_user_health(id,get_user_health(id) + 1)
        else if(ability[id]==3 && alpha[id]>70)
        {
            alpha[id] -= 5
            set_user_rendering(id,kRenderFxGlowShell,255,255,255,kRenderTransAlpha,alpha[id])
        }

        if(adrenaline[id]!=get_pcvar_num(adrenaline_max))
        {
            set_hudmessage(255, 255, 0, 0.90, 0.02, 0, 6.0, 1.0)
            show_hudmessage(id,"--^n| %d^n--",adrenaline[id])
        }
        else
        {
            set_hudmessage(random_num(70,255), random_num(70,255), 0, 0.90, 0.02, 0, 6.0, 1.0)
            show_hudmessage(id,"--^n| %d^n--",adrenaline[id])
        }
    }
}

public menu_cmd(id)
{
    if(get_pcvar_num(adrenaline_toggle) && adrenaline[id]>=get_pcvar_num(adrenaline_max) && !restarting && !freezetime)
    {
        new message[1024]
        new len = format(message,1023,"%L^n^n",id,"MSG_MENUTITLE")
        len += format(message[len],1023-len,"1. %L^n",id,"MSG_SPEED")
        len += format(message[len],1023-len,"2. %L^n",id,"MSG_HEALTH")
        len += format(message[len],1023-len,"3. %L^n^n",id,"MSG_INVIS")
        len += format(message[len],1023-len,"0. %L",id,"MSG_EXIT")
        show_menu(id,(1<<0)|(1<<1)|(1<<2)|(1<<9),message,-1,"adrenaline_menu")
    }
}

public menu_press(id,key)
{
    if(get_pcvar_num(adrenaline_toggle) && !restarting && !freezetime)
    {
        switch(key)
        {
            case 0:
            {
                ability[id]=1
                set_user_maxspeed(id,get_pcvar_float(adrenaline_speed))
            }
            case 1: ability[id]=2
            case 2:
            {
                ability[id]=3
                set_user_rendering(id,kRenderFxGlowShell,255,255,255,kRenderTransAlpha,30)
                alpha[id] = 30
            }
        }
        if(playsound1 && key!=9) emit_sound(id,CHAN_VOICE,sound1,VOL_NORM,ATTN_NORM,0,PITCH_NORM)
    }
    return PLUGIN_HANDLED
}

public CurWeapon(id)
{
    if(get_pcvar_num(adrenaline_toggle) && !freezetime)
    {
        if(ability[id]==1)
        {
            client_cmd(id,"cl_forwardspeed 400;cl_backspeed 400;cl_sidespeed 400")
            new Float:speed = get_pcvar_float(adrenaline_speed)
            set_user_maxspeed(id,speed)
            set_pcvar_float(maxspeed_pcvar,speed)
        }
        if(ability[id]==3 && alpha[id]<200)
        {
            alpha[id] += 20
            set_user_rendering(id,kRenderFxGlowShell,255,255,255,kRenderTransAlpha,alpha[id])
        }
    }
}
__________________
Think Positive - Stay Positive
drumzplaya13 is offline
 



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 17:44.


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