Raised This Month: $ Target: $400
 0% 

extra dmg to a random bullet


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-30-2007 , 12:15   Re: extra dmg to a random bullet
Reply With Quote #6

Try this :
Code:
#include <amxmodx> #include <hamsandwich> new pCvar_Chance, pCvar_Mult public plugin_init() {         register_plugin("Random Extra Damage", "0.1", "author")         pCvar_Chance = register_cvar("randombullet_chance", "5") // 5%         pCvar_Mult = register_cvar("randombullet_mult", "1.2")   // + 20%         RegisterHam(Ham_TakeDamage, "player", "player_TakeDamage") } public player_TakeDamage(id, idinflictor, idattacker, Float:damage, dmgbits) {         if ( ! idattacker || random_num(1,100) > get_pcvar_num(pCvar_Chance) )                 return HAM_IGNORED           new Float:new_damage = damage * get_pcvar_float(pCvar_Mult)         SetHamParamFloat(4, new_damage)         /* just to see */         client_print(idattacker, print_chat, "previous damage inflicted: %.1f , new damage inflicted: %.1f", damage, new_damage)         client_print(id, print_chat, "previous damage took: %.1f , new damage took: %.1f", damage, new_damage)         /* just to see */         return HAM_HANDLED }

Last edited by ConnorMcLeod; 11-30-2007 at 16:08.
ConnorMcLeod 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 11:13.


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