Raised This Month: $ Target: $400
 0% 

[Ham Sandwich] Ham_TakeDamage Function


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Infinity
Junior Member
Join Date: Sep 2009
Old 08-11-2012 , 23:44   Re: [Ham Sandwich] Ham_TakeDamage Function
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
He doesn't want to change the damage to 1.0. He wants to execute code when the damage is 1.0 or greater:

PHP Code:
if( damage 1.0 )
{
    
// do stuff

The if still triggers when I shoot a teammate or if a teammate shoots me, here's a part of my code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>

public register_init(){
    
RegisterHam(Ham_TakeDamage"player""OnPlayerEvent_Damage"1);
}


public 
OnPlayerEvent_Damage(victiminflictorattackerFloat:damagedamagebits){
    if(
damage 1.0){
        
set_user_camo(victimfalse);
        
set_user_camo(attackerfalse);
        }


Last edited by Infinity; 08-12-2012 at 00:33.
Infinity 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 05:52.


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