Raised This Month: $ Target: $400
 0% 

give items to killer for kill


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
simple_user
Member
Join Date: Apr 2012
Location: Latvia, the cube
Old 05-02-2012 , 09:42   give items to killer for kill
Reply With Quote #1

Hi! I'm noob in scripting, and this one, I think, is easy for you - smart guys. Basically I want to add a function to this super player code. I want to give bonus grenades for killer, if one kills the super player.


Code:
public super_kill()
{    

    new victim = read_data(2)
    
    if ( victim != gSuperPlayerCT || victim != gSuperPlayerT  ) return

    {
        
    new killer = read_data(1)
    give_item(killer,"weapon_hegrenade")
    cs_set_user_bpammo(killer,CSW_HEGRENADE,2)
    
    give_item(killer,"weapon_flashbang")
    cs_set_user_bpammo(killer,CSW_FLASHBANG,1)
    client_print(killer, print_center, "You've got a grenade bonus for killing superplayer!")
    
    }
}
So:

if ( victim != gSuperPlayerCT || victim != gSuperPlayerT ) return // this has no effect at all

And if I change it to:

if ( victim == gSuperPlayerCT || victim == gSuperPlayerT ) // after I kill the special player, game kicks me out and I get text in console:

Code:
SZ_GetSpace: overflow on netchan->message
WARNING: reliable overflow for me.
me. overflowed
Reliable channel over
Or:

// Maybe I'm registering event incorrectly:

register_event("DeathMsg", "super_kill", "a", "1>0")

Last edited by simple_user; 05-07-2012 at 23:14.
simple_user is offline
Send a message via Skype™ to simple_user
 


Thread Tools
Display Modes

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