Raised This Month: $ Target: $400
 0% 

[ZP]Extra Items: Damage bullets


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Pach
Senior Member
Join Date: Feb 2009
Location: Russian Federation
Old 04-01-2009 , 02:48   [ZP]Extra Items: Damage bullets
Reply With Quote #1

Where a mistake? Help please!
Code:
#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>

new bool:g_bHasDamage[33]
new g_iItem

public plugin_init()
{
	g_iItem = zp_register_extra_item("Damage bullets", 20, ZP_TEAM_HUMAN)
	
	RegisterHam(Ham_Spawn, "player", "Fwd_PlayerSpawn_Post", 1)
	RegisterHam(Ham_TakeDamage, "player", "Fwd_TakeDamage_Pre", 0)
}

public zp_extra_item_selected(id, item)
	if (item == g_iItem)
		g_bHasDamage[id] = true

public Fwd_PlayerSpawn_Post(id)
	if (g_bHasDamage[id])
		g_bHasDamage[id] = false
		
public Fwd_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits)
{
	if (!is_user_connected(attacker))
		return HAM_IGNORED
		
	if (g_bHasDamage[attacker])
	{
		SetHamParamFloat(4, (damage*2.0))
		return HAM_SUPERCEDE
	}
	return HAM_IGNORED
}
__________________
Sorry for my bad English.
Pach is offline
Send a message via ICQ to Pach Send a message via Skype™ to Pach
 



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 16:53.


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