Raised This Month: $ Target: $400
 0% 

log_kill and frags problems


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
spunko
Senior Member
Join Date: Jun 2005
Location: Ecuador
Old 12-03-2006 , 15:46   log_kill and frags problems
Reply With Quote #1

hi.. the problem with this code is that when you kill someone, it sets the frags to you (1 / 0) but the victim gets (-1 / 1).. so if you kill him again u will have (2 / 0) and the victim (-2 / 2)

I dunno what the problem is.. can any one help me with this?
PHP Code:
public event_damageid ) {
 
 new 
victim_id id;
 if( !
is_user_connectedvictim_id ) ) return PLUGIN_CONTINUE
 
new dmg_take read_data);
 new 
dmgtype read_data);
 new 
Float:multiplier get_pcvar_float(CVAR_DAMAGE);
 new 
Float:damage dmg_take multiplier;
 new 
health get_user_healthvictim_id );
 
 new 
iWeapIDattacker_id get_user_attackervictim_idiWeapID );
 
 if( !
is_user_connectedattacker_id ) || !is_user_alivevictim_id ) ) {
  return 
PLUGIN_HANDLED
 
}
 
 if( 
iWeapID == CSW_KNIFE && knife_model[attacker_id] == ) {
 
  if( 
floatround(damage) >= health ) {
   if( 
victim_id == attacker_id ) {
    return 
PLUGIN_CONTINUE
    
}else{
    
log_killattacker_idvictim_id"knife");
   }
 
   return 
PLUGIN_CONTINUE
   
}else {
   if( 
victim_id == attacker_id ) return PLUGIN_CONTINUE
 
   fakedamage
victim_id"weapon_knife"damagedmgtype );
  }
 }
 return 
PLUGIN_CONTINUE
}
 
stock log_kill(killervictimweapon[],headshot) {
 
user_silentkillvictim );
 
 
message_beginMSG_ALLget_user_msgid"DeathMsg" ), {0,0,0}, );
 
write_bytekiller );
 
write_bytevictim );
 
write_byteheadshot );
 
write_stringweapon );
 
message_end();
 
 new 
kfrags get_user_fragskiller );
 
set_user_fragskillerkfrags );
 new 
vfrags get_user_fragsvictim );
 
set_user_fragsvictimvfrags );
 
 return  
PLUGIN_CONTINUE

__________________
spunko is offline
Send a message via MSN to spunko
 



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 06:52.


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