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

Adrenaline Boost


Post New Thread Reply   
 
Thread Tools Display Modes
bumbastik
Member
Join Date: Jan 2007
Old 01-15-2007 , 06:35   Re: Adrenaline Boost
Reply With Quote #11

Very nice mod. Can you create:
if player hp <=50, then adrenaline ON, but if player hp <=20, then adrenaline OFF
bumbastik is offline
bumbastik
Member
Join Date: Jan 2007
Old 01-16-2007 , 06:57   Re: Adrenaline Boost
Reply With Quote #12

Hello? Is it very hard to make???

Also I find a little bug.
bumbastik is offline
Sav
Junior Member
Join Date: Dec 2006
Old 01-22-2007 , 21:45   Re: Adrenaline Boost
Reply With Quote #13

post ur bug and donts spam ull get ban there strict about that stuff..

but i got a sugestion.. why dont you set it to instantly go to 100 hp like dude said and let it go 15 seconda wit higher speed and wat not and no damage taken if oyu know wat i mean cuz if it takes damage and he goes to lower then 10 hp and hes in adrenilen will it activate it again? no damage wit a drenilen and then after its ova if user got damaged he dies you get wat im saying?
Sav is offline
Sav
Junior Member
Join Date: Dec 2006
Old 01-22-2007 , 21:57   Re: Adrenaline Boost
Reply With Quote #14

Hey i added a motd to your code and made them use pcvars im not exactly sure if it workd haah but ill post code and let u look at it.
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]
new g_Switch;
new g_Switch2;
new g_Switch3;
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")
 g_Switch = register_cvar("amx_adrenaline","1")
 g_Switch2 = register_cvar("amx_adrenaline_health","5")
 g_Switch3 = register_cvar("amx_adrenaline_motd", "1")
 register_clcmd("say /adrenaline", "adrenalinemotd");
}
// check if the player has low enough health to gain an adrenaline boost
public damage_event(id)
{
 if (!get_pcvar_num(g_Switch))
  return PLUGIN_CONTINUE
 if (g_adrenaline[id])
  return PLUGIN_CONTINUE
 
 if (!is_user_alive(id))
  return PLUGIN_CONTINUE
 if (get_user_health(id) <= get_pcvar_num(g_Switch2)) 
 {
  set_user_maxspeed(id, SPEED)
  set_user_rendering(id, kRenderFxGlowShell, RED, GREEN, BLUE, kRenderNormal, 0)
  message_begin(MSG_ONE, get_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_ONE, get_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], num, player
 get_players(players, num)
 for (new i=0; i<num; i++)
 {
  player = players[i]
  if(!is_user_connected(player))
   continue
  if(g_adrenaline[player])
  {
   set_user_maxspeed(player, 0.0)
   set_user_rendering(player, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 0)
   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(id, SPEED)
 }
 return PLUGIN_CONTINUE
}
public adrenalinemotd(id)
{
        if(get_pcvar_num(g_Switch3))
        {
                show_motd ( id, "addons\amxmodx\configs\adrenaline.txt", "Adrenaline Information");
        }
}
it compiled no errors and no warning. let me know if you like it or wat not..
motd is just a description of the plugin put it in your amxmodx configs folder save as TXT!!!! file
Sav is offline
robobble
Junior Member
Join Date: Jan 2007
Old 01-22-2007 , 22:18   Re: Adrenaline Boost
Reply With Quote #15

Quote:
Originally Posted by Sav View Post
post ur bug and donts spam ull get ban there strict about that stuff..

but i got a sugestion.. why dont you set it to instantly go to 100 hp like dude said and let it go 15 seconda wit higher speed and wat not and no damage taken if oyu know wat i mean cuz if it takes damage and he goes to lower then 10 hp and hes in adrenilen will it activate it again? no damage wit a drenilen and then after its ova if user got damaged he dies you get wat im saying?
lmao.
robobble is offline
cira91
Junior Member
Join Date: Sep 2009
Old 09-29-2009 , 18:51   Re: Adrenaline Boost
Reply With Quote #16

Sorry i ask ... i like this plugin ... where to put CVARS ???
i can`t set amx_adrenaline_healt 55 ( Unknown command )

can you help me ? thx
cira91 is offline
DjBmXaS
Junior Member
Join Date: Dec 2009
Old 12-19-2009 , 17:43   Re: Adrenaline Boost
Reply With Quote #17

Does it work if I slap my self whit hp until i have hp? It will work? For me it doesn't idk. But when i set map 1hp slimi it shows green and sais something like adrenaline. Its working?
DjBmXaS is offline
DjBmXaS
Junior Member
Join Date: Dec 2009
Old 12-19-2009 , 17:43   Re: Adrenaline Boost
Reply With Quote #18

*whit 5hp until i have 1hp
DjBmXaS is offline
2called-chaos
Senior Member
Join Date: Jul 2006
Old 11-09-2013 , 13:21   Re: Adrenaline Boost
Reply With Quote #19

I made a modified version for my needs and maybe others need something similar. It triggers by default on 100HP so every hit activates highspeed. I removed the visual effect. I added a check because sometimes if you respawn (deatchmatch) and you get your weapon (gungame) you had to switch to knive in order to get the speed again. I also added a custom sound on round start (when adrenaline gets removed) which is a german "slooooooooow" but you can remove the 2 lines for this (call and precache)...

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

#define SPEED 400.0 // Note: increasing this is likely to have no effect unless you alter server & clients cvars

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

public plugin_init()
{
  register_plugin("adrenaline boost", "1.0", "watch, modified by 2called-chaos")

  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")
  RegisterHam(Ham_Spawn, "player", "player_spawned", 1)

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


// set player speed if plugin enabled, player alive and adrenaline activated
public set_speed(id)
{
  // plugin disabled
  if (!get_cvar_num("amx_adrenaline"))
    return PLUGIN_CONTINUE

  // dead player
  if (!is_user_alive(id))
    return PLUGIN_CONTINUE

  // no adrenaline
  if (!g_adrenaline[id])
    return PLUGIN_CONTINUE

  // set speed
  set_user_maxspeed(id, SPEED)

  return PLUGIN_CONTINUE
}


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

  // has adrenaline
  if (g_adrenaline[id])
    return PLUGIN_CONTINUE

  // is dead
  if (!is_user_alive(id))
    return PLUGIN_CONTINUE

  // trigger adrenaline?
  if (get_user_health(id) <= get_cvar_num("amx_adrenaline_health"))
  {
    set_user_maxspeed(id, SPEED)
    client_cmd(id, "spk fvox/adrenaline_shot.wav")
    g_adrenaline[id] = true
  }
  return PLUGIN_CONTINUE
}


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

  new players[32], num, player
  get_players(players, num)
  for (new i=0; i<num; i++)
  {
    player = players[i]

    if(!is_user_connected(player))
      continue

    if(g_adrenaline[player])
    {
      set_user_maxspeed(player, 0.0)
      g_adrenaline[player] = false
      client_cmd(player, "spk sound/fcs-gungame/slow.wav")
    }
  }
  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)
  {
    return set_speed(id)
  }
  return PLUGIN_CONTINUE
}


// ensure speed is set on respawn without roundend
public player_spawned(id)
{
  set_speed(id)
  set_task(0.2, "set_speed", id)
  return PLUGIN_CONTINUE
}


// precache files
public plugin_precache()
{
  precache_sound("fvox/adrenaline_shot.wav")
  precache_sound("fcs-gungame/slow.wav")
}
__________________


My post was useful? Than klick here, please. Tanks.

Last edited by 2called-chaos; 11-09-2013 at 13:22.
2called-chaos is offline
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 18:59.


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