Raised This Month: $ Target: $400
 0% 

friendlynade help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Administrator
Member
Join Date: Jun 2014
Old 06-18-2014 , 02:08   friendlynade help
Reply With Quote #1

Hi guys.
I have a problem, does not put his grenade damage.

Code:
#include <amxmodx> 
#include <amxmisc> 
#include <fun>

public plugin_init() { 
	register_plugin("Friendly grenade damage","0.1","omnipotent") 
	register_event("Damage","damage","b")
} 

public damage(victim)
{
		new attacker, health
		health = 100 - read_data(2)
		get_user_attacker(victim)
		if (get_user_team(attacker) == get_user_team(victim)) 
		{
			set_user_health(victim,health)
		}
}
Administrator is offline
Old 06-18-2014, 02:30
EthicalHacker007
This message has been deleted by hornet. Reason: Please keep on topic
Old 06-18-2014, 02:37
Administrator
This message has been deleted by hornet. Reason: Please keep on topic
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 06-18-2014 , 05:53   Re: friendlynade help
Reply With Quote #4

get_user_attacker(victim) - returns attacker and it is not stored anywhere, does this plugin even compile?

Last edited by jimaway; 06-18-2014 at 05:54.
jimaway is offline
Administrator
Member
Join Date: Jun 2014
Old 06-18-2014 , 21:45   Re: friendlynade help
Reply With Quote #5

pls, help me fix this plugin
Administrator is offline
Bladell
Senior Member
Join Date: Jun 2012
Old 06-19-2014 , 04:15   Re: friendlynade help
Reply With Quote #6

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <fun>

public plugin_init() { 
    
register_plugin("Friendly grenade damage","0.1","omnipotent"
    
register_event("Damage","damage","b")


public 
damage(victim)
{
        new 
attackerhealth
        health 
100 read_data(2)
        
attacker get_user_attacker(victim)
        if (
get_user_team(attacker) == get_user_team(victim)) 
        {
            
set_user_health(victim,health)
        }

Not tested...
Bladell is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-19-2014 , 04:23   Re: friendlynade help
Reply With Quote #7

Where exactly is the part with the grenade? And, Bladell, you actually provided the same code. And I thi.k it's better to use Ham_TakeDamage and return it.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Bladell
Senior Member
Join Date: Jun 2012
Old 06-19-2014 , 05:24   Re: friendlynade help
Reply With Quote #8

Quote:
Originally Posted by Flick3rR View Post
Where exactly is the part with the grenade? And, Bladell, you actually provided the same code. And I thi.k it's better to use Ham_TakeDamage and return it.
I actually didn't provided the same code...

I changed
get_user_attacker(victim) to attacker = get_user_attacker(victim)
Bladell is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-19-2014 , 05:27   Re: friendlynade help
Reply With Quote #9

Оh, I see. My bad. But still, where is the grenade part? Also, try to make it with Ham_TakeDamage and return, it will be more efficient and won't set HP on each shoot.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-19-2014 , 19:56   Re: friendlynade help
Reply With Quote #10

Guys please test your plugins before you post them. The given example doesn't make any sense as it is not related at all to grenade damage. You should hook TakeDamage() and manipulate the team / damage there.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 21:17.


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