Raised This Month: $ Target: $400
 0% 

Weapon Damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-13-2007 , 17:55   Re: Weapon Damage
Reply With Quote #2

Code:
#include <amxmodx> // used to be "amxmod", that's an old AMX include #include <engine> // used to be "Vexd_Utilities", that's an old AMX include #include <fun> // used to be "Fun", I believe includes are case-sensitive? public plugin_init() {     register_plugin("Scout Damage", "99.9", "Blah")     register_event("Damage", "scout_damage", "b", "2!0") } public scout_damage(id) // used to be "damage", but that's not how you registered it {     if (!is_user_alive(id)) return     new damage = read_data(2)     new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)     new headshot = bodypart == 1 ? 1 : 0     if ( weapon == CSW_SCOUT ) { // removed is_user_alive check, you already did one         // got rid of extraDamage calculation         ExtraDamage( id, attacker, float(damage), "weapon_scout", headshot ) // don't check for 0 damage, it's done in your register_event     } } stock ExtraDamage(victim,attacker,Float:damage,weapon[],headshot) {     new Float:health = entity_get_float(victim,EV_FL_health);     if(health <= 0.0) return;     if(health - damage <= 0.0)     {         user_silentkill(victim);         make_deathmsg(attacker,victim,headshot,weapon);         set_user_frags(attacker,get_user_frags(attacker)+1);     }     else fakedamage(victim,weapon,damage,DMG_BULLET); }

This should convert it to AMXX and get it to work. I changed your extraDamage part, because (damage * 2) - damage is the same as damage * 1, so I assume you just want double damage. I also added an ExtraDamage function, because AMXX doesn't have one by default.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS

Last edited by XxAvalanchexX; 02-13-2007 at 18:00.
XxAvalanchexX 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 00:40.


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