Raised This Month: $ Target: $400
 0% 

Would something like this work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 10-29-2009 , 19:50   Would something like this work?
Reply With Quote #1

What i want this to do is
Check for the attacker/victim is alive
if they are enemies
and if the knife was used
Damage * pcvar


Code:
public PlayerHurt( victim, inflictor, attacker, Float:damage, damagebits )// Not sure on the last one {         new szWeapon[20];     szWeapon = get_user_weapon2(id);         if( equal (szWeapon, "knife") )     {         if(is_user_alive( victim ) && is_user_alive( attacker ) )         {                     if(cs_get_user_team( victim ) != cs_get_user_team( attacker ) )             {                 SetHamParamFloat(4, damage * get_pcvar_float(dmg_multi));             }         }     } } public get_user_weapon2( id ) {     new szWeapon[ 20 ];     get_weaponname( get_user_weapon( id ), szWeapon, charsmax( szWeapon ) );         return szWeapon[7]; }
Doc-Holiday is offline
VMAN
Senior Member
Join Date: Oct 2007
Location: California, US
Old 10-29-2009 , 23:28   Re: Would something like this work?
Reply With Quote #2

try it
__________________
VMAN is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 10-29-2009 , 23:50   Re: Would something like this work?
Reply With Quote #3

Quote:
Originally Posted by VMAN View Post
try it

im not at home cant test......

on my laptop via sprint mobile
Doc-Holiday is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-29-2009 , 23:59   Re: Would something like this work?
Reply With Quote #4

Code:
#include < amxmodx > #include < hamsandwich > new pCvarDamageMult; new g_iMaxPlayers; public plugin_init( ) {     RegisterHam( Ham_TakeDamage, "player", "FwdPlayerDamage" );         pCvarDamageMult = register_cvar( "knife_damage_mult", "2.0" );         g_iMaxPlayers = get_maxplayers( ); } public FwdPlayerDamage( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits ) {     if( ( 1 <= iAttacker <= g_iMaxPlayers )     && iAttacker != iVictim     && iAttacker == iInflictor     && get_user_weapon( iAttacker ) == CSW_KNIFE ) {         SetHamParamFloat( 4, ( fDamage * get_pcvar_float( pCvarDamageMult ) ) );     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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:48.


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