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:
loose xp if get killed by knife
Moderator: Forum Moderator
- YamiKaitou
- Forum Moderator
- Posts: 1925
- Joined: Wed Feb 01, 2006 4:33 pm
- Contact:
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]
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]
No support via PM or Email