Raised This Month: $ Target: $400
 0% 

give items to killer for kill


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-02-2012 , 13:08   Re: give items to killer if victim == special player
Reply With Quote #8

what data type is gSuperPlayerCT/T? Make sure they are, in fact, IDs for the player you wish them to be. Try this as a means of debug....it'll print the name of the player that killed you, if that method is even called.

PHP Code:
//function header of super_kill
new sz_attacker[32], sz_victim[32]
get_user_name(attackerIDsz_attacker31)
get_user_name(victimIDsz_victim31)
        
// say if the function was even called
client_print(0print_chat"[Debug] %s killed %s"sz_attackersz_victim)    
if(
victimID != gSuperPlayerCT || victimID != gSuperPlayerT || !is_user_alive(killerID)) 
{
        
// confirm gSuperPlayer is improperly used
    
client_print(attackerIDprint_chat"[Debug] %s was not a SuperPlayer"sz_victim)    
    return 
HAM_HANDLED 
}
        
// giving the grenades isn't done right
client_print(attackerIDprint_chat"[Debug] %s was, in fact, a SuperPlayer"sz_victim)    

give_item(killerID,"weapon_hegrenade"
cs_set_user_bpammo(killerID,CSW_HEGRENADE,2
     
give_item(killerID,"weapon_flashbang"
cs_set_user_bpammo(killerID,CSW_FLASHBANG,1
client_print(killerIDprint_center"You've got a grenade bonus for killing superplayer!"

return 
HAM_HANDLED 
Liverwiz is offline
 



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 07:45.


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