Raised This Month: $ Target: $400
 0% 

Detect if a player has made damage to another player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-15-2014 , 18:20   Re: Detect if a player has made damage to another player
Reply With Quote #1

Search
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 11-15-2014 at 18:21.
YamiKaitou is offline
Hackerpcs
Member
Join Date: Jul 2012
Location: Greece
Old 11-15-2014 , 18:46   Re: Detect if a player has made damage to another player
Reply With Quote #2

PHP Code:
new bool:bGivenDamage33 ]

// plugin_init()
RegisterHam(Ham_TakeDamage"player""fw_takedamage"

public 
fw_takedamage(victiminflictorattackerFloat:damagebits)
{
    if (
attacker == victim)
    {
        return 
HAM_IGNORED;
    }

    if (
attacker == inflictor)
    {
        
bGivenDamage[attacker]=true;
    }

    return 
HAM_IGNORED;
}

public 
blabla(id)
{
    if(
bGivenDamage[id])
    {
        
client_print(idprint_center"You have inflicted damage");
    }

Is this correct?
Hackerpcs is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-15-2014 , 19:13   Re: Detect if a player has made damage to another player
Reply With Quote #3

Quote:
Originally Posted by Hackerpcs View Post
Is this correct?
Did you test it?
__________________
fysiks 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 17:37.


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