Raised This Month: $ Target: $400
 0% 

Boost Knife attack damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Mlk27
Veteran Member
Join Date: May 2008
Old 01-19-2009 , 00:03   Boost Knife attack damage
Reply With Quote #1

i'm trying to boost knife attack damage just for specific player. Im not sure if this correct.

Code:
#include <amxmodx>
#include <hamsandwich>

new g_knifedamage
new bool:g_superknife[33]

new g_MaxPlayers

public plugin_init()
{
	register_plugin("Super Knife", "0.1", "AUTHOR")

	g_knifedamage = register_cvar("knife_dmg", "100.0")

	register_event("DeathMsg", "eDeathMsg", "a")
	register_event("HLTV", "event_round_start", "a", "1=0", "2=0")	
	
	RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
	register_clcmd("say /knife", "deadly_knife")

	g_MaxPlayers = get_maxplayers()
}

public client_connect(id)
{
	g_superknife[id] = false
}

public client_disconnect(id)
{
	g_superknife[id] = false
}

public eDeathMsg()
{
	g_superknife[read_data(2)] = false
}

public event_round_start()
{
	for(new id; id <= g_MaxPlayers; id++) g_superknife[id] = false
}

public deadly_knife(id)
{
	g_superknife[id] = true
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
	if(g_superknife[attacker])
	{
		SetHamParamFloat(4, get_pcvar_float(g_knifedamage))
		return HAM_IGNORED;
	}
	
	return HAM_SUPERCEDE;
}
Mlk27 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 01:38.


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