AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   find out when ppl are hit (https://forums.alliedmods.net/showthread.php?t=11101)

Bubby 03-09-2005 18:29

find out when ppl are hit
 
how do i find out when people are hit by another person?


like person A gets hit by person B then it tells me when person b hit person A and then run a command on person A automatticly


plz help me

thx

:)

xeroblood 03-09-2005 19:09

You should be able to get lots of info from this example:
Code:
#include <amxmodx> new szBodyParts[7][] = {"Head","Chest","Stomach","Right-Arm","Left-Arm","Right-Leg","Left-Leg"} public plugin_init() {     register_event( "Damage", "Event_Damage", "b", "2!0" ) } public Event_Damage( id ) {     new iWeapon, iBody, aID = get_user_attacker( id, iWeapon, iBody )     // Check for Invalid Attacker, or If Attacker is Self/World     if( !aID || id == aID ) return PLUGIN_CONTINUE     new iDamage = read_data( 2 ) // The amount of Damage Inflicted..     new szVictim[32], szAttacker[32], szWeaponName[32]     get_user_name( id, szVictim, 31 )     get_user_name( aID, szAttacker, 31 )     get_weaponname( iWeapon, szWeaponName, 31 )     // Tell Victim What Happened     client_print( id, print_chat, "%s Hit You With %s in %s For %d HP!", szAttacker, szWeaponName, szBodyParts[iBody], iDamage )     // Tell Attacker What Happened     client_print( aID, print_chat, "You Hit %s With %s in %s For %d HP!", szVictim, szWeaponName, szBodyParts[iBody], iDamage )     // To perform other commands/actions on the Victim, use     id     // To perform other commands/actions on the Attacker, use   aID     return PLUGIN_CONTINUE }

Bubby 03-09-2005 20:42

holyshit man thx thx thx


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

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