Raised This Month: $ Target: $400
 0% 

extra dmg to a random bullet


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-28-2007 , 14:46   Re: extra dmg to a random bullet
Reply With Quote #2

It's not exactly only bullets but that can be changed.
Code:
#include <amxmodx> #include <csx> #include <fun> new pCvar_Chance, pCvar_Mult; new gmsgDeathMsg; public plugin_init() {     register_plugin("", "", "")     pCvar_Chance = register_cvar("randombullet_chance", "5"); // Percent     pCvar_Mult = register_cvar("randombullet_mult", "1.5");         gmsgDeathMsg = get_user_msgid("DeathMsg"); } public client_damage(a, v, damage, wpnID, hitplace, TA) {         if ( ! a || random_num(1,100) > get_pcvar_num(pCvar_Chance) )         return;         damage = floatround( get_pcvar_float(pCvar_Mult) * damage ) - damage;         new vHealth = get_user_health(v);         if ( vHealth < damage ) {                 user_silentkill(v);                 new wpnName[32];         get_weaponname(wpnID, wpnName, 31);                 message_begin(MSG_BROADCAST, gmsgDeathMsg);         write_byte(a);         write_byte(v);         write_byte(hitplace == 1 ? 1 : 0);         write_string(wpnName);         message_end();                 set_user_frags(a, get_user_frags(a) + 1);         set_user_frags(v, get_user_frags(v) + 1);     }     else         set_user_health(v, vHealth - damage); }

Last edited by [ --<-@ ] Black Rose; 11-29-2007 at 02:29.
[ --<-@ ] Black Rose 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