AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   double damage? (https://forums.alliedmods.net/showthread.php?t=3580)

ngsucks 07-10-2004 04:43

double damage?
 
i wanted to make double damage.

for example.

if some one uses the mp5's or m4a1, make it doulbe the normal damage..


im lost on how to go about doing this...

Dygear 07-10-2004 05:34

here is how i would do it.

Code:
#include <amxmodx> #include <cstrike> plugin_init(){     register_plugin("2x damage","0.1","Dygear") } round_start(){     new dyHealth[32], dyDamage[32], dyUserID[32]     get_user_health(id, dyHealth, 31)     get_user_userid(id, dyUserID, 31)         /*     * You can get users health at round start then     * any time they are hit, you get the damage     * by finding there health at the start of the round     * log it to a file and taking it when they get hit,     * then find the users health and at that point do this ...     * logdyHealth - dyhealth = dyDamage     * then just take the dyDamage and x2 :).     */     /* TELL ME IF THERE IS A BETTER WAY TO GET DAMAGE.     * B/C I NEED TO KNOW, FOR A PLUGIN THAT IS GOING     * TO BE RELEASED SOON, JUST NEED THIS ONE FUCKIN THING.     */ }

ngsucks 07-10-2004 05:39

thanks ur bomb!

but this wont work for a superhero!

anyoen who knows a different way!
or will this work fora superhero?

is there a way to get the amount of damage i do to the enemy?
if there is i can do that, then do shExtraDamage(id, enemy, damage, "2x damage")

Ryan 07-10-2004 12:41

if you want attacks to do double damage you need to use the damage event...

Code:
public Ev_Damage( vIndex ) {     new aIndex = get_user_attacker( vIndex );     new iDamage = read_data( 2 );         shExtraDamage( aIndex, vIndex, iDamage /*, This probably isnt necessary ... "2x damage"*/ );     return PLUGIN_CONTINUE; } register_plugin() {     // ... other stuff in here     register_event( "Damage", "Ev_Damage", "b" );     return PLUGIN_CONTINUE; }

ngsucks 07-10-2004 17:06

u da man if this wrks!

thnks

Dygear 07-10-2004 20:56

Ryan would that also work for this.

http://forums.alliedmods.net/showthread.php?t=3570

What i am trying to do it, get the ammount of damage done, and free say style it in to the center of the screen.


All times are GMT -4. The time now is 14:42.

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