Page 1 of 1

loose xp if get killed by knife

Posted: Thu Mar 22, 2007 12:23 am
by six
i was wondering if its possible to make so if a player get killed by knife he lose 50 xp to the atacker thanks for everything again

--- Please enter the following information for support ---
War3ft Version: rc5 v3.0
Amxmodx Version:1.76c
Metamod Version: 1.19p28
amxx list:
amxx modules:
meta list:

Posted: Thu Mar 22, 2007 1:18 pm
by YamiKaitou
Same user posted on the Amxx forums as well. Someone else posted a new plugin that might do it, but I have made a code edit for it. Posting it there and here.

I have only tested compiling it on 1.76c Linux. Should work, but it might not

In the file XP.inl, find the XP_onDeath function.

Then, find this code
[small] // User had a headshot? Give bonus XP!
if ( iHeadshot )
{
iBonusXP = XP_Give( iAttacker, KILL_HEADSHOT );

if ( iBonusXP != 0 && get_pcvar_num( CVAR_wc3_show_kill_obj ) )
{
client_print( iAttacker, print_chat, "%s You have been awarded %d XP for getting a headshot", g_MODclient, iBonusXP );
}
}[/small]

After that, add this code
[small] //Victim was killed by knife? Added by Yami Kaitou
if ( iWeaponIndex == CSW_KNIFE)
{
iBonusXP = XP_Give( iVictim, -50 );

if ( iBonusXP != 0 && get_pcvar_num( CVAR_wc3_show_kill_obj ) )
{
client_print( iVictim, print_chat, "%s You lost %d because you died by a knife", g_MODclient, abs( iBonusXP ) );
}
}[/small]

Posted: Sun Mar 25, 2007 2:40 am
by six
sorry i didnt post here to let every1 know dat yamikaitou made it happen
IT WORK !!!! thanks again yami :P