Raised This Month: $ Target: $400
 0% 

TS Melee


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
CodeMaster
Junior Member
Join Date: Dec 2008
Old 12-24-2008 , 17:58   Re: TS Melee
Reply With Quote #2

If you wanna know is player hit in any mean you can use hamsandwich's "Ham_TakeDamage"

Example:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Damage Detect"
#define VERSION "1.0"
#define AUTHOR "CodeMaster"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_TakeDamage,"player","hook_damage",0// if you want post check change 0 to 1
}

public 
hook_damage(id,inflictor_id,attacker_id,Float:damage,damagebits) {
    
// Your code here...
    
    // inflictor_id represents "weapon" id, so maybe if melee attacks has id like custom weapon,
    // you could use:
    
    
if(inflictor_id 30) {     //Higher than highest standard weapon id?
        // if it was kung fu?
    
}
    
    return 
HAM_HANDLED

I'm HIGHLY unsure about that inflictor part, cause I never used melee attacks, but Ham_TakeDamage detects any sort of damage so it still may come handy.

Cheers ;)

Nidza
__________________
+karma me if you found me useful
[60% -- ||||||||||] Learning AMXModX functions for better adaption to AMXModX Pawn
[100% - ||||||||||] Pawn Readaptation

CodeMaster 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 09:18.


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