Raised This Month: $ Target: $400
 0% 

help me edit a script!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mikaelnatan13
Member
Join Date: Apr 2020
Old 06-05-2020 , 00:01   Re: help me edit a script!!
Reply With Quote #1

thx
mikaelnatan13 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-05-2020 , 10:47   Re: help me edit a script!!
Reply With Quote #2

Not sure what you mean
__________________
Bugsy is offline
mikaelnatan13
Member
Join Date: Apr 2020
Old 06-05-2020 , 11:05   Re: help me edit a script!!
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Not sure what you mean
how I shoot the zombie, but it keeps increasing forever until I leave the server. I wanted to q when you shoot a zombie after a while resetase the counter

Last edited by mikaelnatan13; 06-05-2020 at 11:08.
mikaelnatan13 is offline
mikaelnatan13
Member
Join Date: Apr 2020
Old 06-05-2020 , 11:13   Re: help me edit a script!!
Reply With Quote #4

when I shoot until I kill a zombie, I deal 2300 damage if I don't fire another zombie in 10s, the damage counter goes back to 0
mikaelnatan13 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-05-2020 , 11:19   Re: help me edit a script!!
Reply With Quote #5

So you want it to reset at 10 seconds if a zombie isn't shot?
__________________

Last edited by Bugsy; 06-05-2020 at 11:19.
Bugsy is offline
mikaelnatan13
Member
Join Date: Apr 2020
Old 06-05-2020 , 11:54   Re: help me edit a script!!
Reply With Quote #6

Quote:
Originally Posted by Bugsy View Post
So you want it to reset at 10 seconds if a zombie isn't shot?
If I don't hit a zombie
mikaelnatan13 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-05-2020 , 18:13   Re: help me edit a script!!
Reply With Quote #7

This will show the attacker his cumulative damage, reverting back to 0 if the attack occurs greater than or requal to 10 seconds from the last attack.

The victim sees the current attack damage.

Not sure how you determine which player is a zombie.

10 second interval is controlled by cvar.
PHP Code:

#include <amxmodx>

new const Version[] = "0.1";

#define MAX_PLAYERS 32

enum HUDSyncObj
{
    
hsVictim,
    
hsAttacker
}
new 
hsHUDObjHUDSyncObj ];

enum DamageInfo
{
    
LastDamage,
    
TotalDamage,
    
LastDamageTime
}
new 
diDamageInfoMAX_PLAYERS ][ DamageInfo ];

new 
g_pResetSeconds;

public 
plugin_init()
{
    
register_plugin"Damage HUD" Version "bugsy" );
    
    
register_event"Damage" "xOnDamage" "b" "2!0" "3=0" "4!0" );  
    
    
g_pResetSeconds register_cvar"dh_resetseconds" "10" );
    
    
hsHUDObjhsVictim ] = CreateHudSyncObj();
    
hsHUDObjhsAttacker ] = CreateHudSyncObj();
}

public 
xOnDamageid )
{
    static 
xAttacker bool:bTimeThresholdExceeded;
    
    
xAttacker get_user_attackerid );
    
    
bTimeThresholdExceeded bool:( ( get_systime() - diDamageInfoxAttacker ][ LastDamageTime ] ) >= get_pcvar_numg_pResetSeconds ) );
    
diDamageInfoxAttacker ][ LastDamage ] = read_data);
    
diDamageInfoxAttacker ][ TotalDamage ] = diDamageInfoxAttacker ][ LastDamage ] + ( bTimeThresholdExceeded diDamageInfoxAttacker ][ TotalDamage ] );
    
diDamageInfoxAttacker ][ LastDamageTime ] = get_systime();
    
    
set_hudmessage255 0.45 0.50 0.1 3.0 0.1 0.1 );
    
ShowSyncHudMsgid hsHUDObjhsVictim ] , "%i" diDamageInfoxAttacker ][ LastDamage ] );   
    
    if ( 
is_user_connectedxAttacker ) )
    {
        
set_hudmessage100 200 , -1.0 0.55 0.1 3.0 0.02 0.02 );
        
ShowSyncHudMsgxAttacker hsHUDObjhsAttacker ] , "%i" diDamageInfoxAttacker ][ TotalDamage ] );      
    }

__________________
Bugsy 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 16:57.


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