Raised This Month: $ Target: $400
 0% 

Boost Knife attack damage


Post New Thread Reply   
 
Thread Tools Display Modes
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
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-19-2009 , 00:28   Re: Boost Knife attack damage
Reply With Quote #2

Code:
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;
}

Code:
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
	if(g_superknife[attacker])
	{
		SetHamParamFloat(4, get_pcvar_float(g_knifedamage))
		return HAM_HANDLED;
	}
	
	return HAM_IGNORED;
}
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-19-2009 , 01:04   Re: Boost Knife attack damage
Reply With Quote #3

Code:
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
	if(attacker == inflictor && is_user_alive(attacker) && get_user_weapon(attacker) == CSW_KNIFE && g_superknife[attacker])
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-19-2009 , 12:14   Re: Boost Knife attack damage
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
Code:
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
	if(attacker == inflictor && is_user_alive(attacker) && get_user_weapon(attacker) == CSW_KNIFE && g_superknife[attacker])
How did I miss that?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply


Thread Tools
Display Modes

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