give items to killer for kill
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()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// Maybe I'm registering event incorrectly: register_event("DeathMsg", "super_kill", "a", "1>0") |
Re: give items to killer if victim == special player
This is how i would do it
PHP Code:
PHP Code:
|
Re: give items to killer if victim == special player
Quote:
Code:
register_event("DeathMsg", "super_kill", "a", "1>0")PHP Code:
Code:
public super_kill()PHP Code:
PHP Code:
The variables were changed to reflect the new header shouldgib isn't used. Ignore that variable. |
Re: give items to killer if victim == special player
Looks fine to me, but now it doesn't compile.
HTML Code:
error 035: argument type mismatch <argument 1>in line 79: HTML Code:
RegisterHam("Ham_Killed", "player", "super_kill", 1) |
Re: give items to killer if victim == special player
RegisterHam("Ham_Killed", "player", "super_kill", 1)
-> RegisterHam(Ham_Killed, "player", "super_kill", 1) |
Re: give items to killer if victim == special player
no errors in compiling. no grenades if super player killed, either.
ok. I made a conditional statement: Code:
if(victimID == gSuperPlayerCT || victimID == gSuperPlayerT ) |
Re: give items to killer if victim == special player
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:
|
Re: give items to killer if victim == special player
new gSuperPlayerT
new gSuperPlayerCT these are variables. do I need to make id equal to gSuperPlayer, like in this code? : Code:
if ( id ) |
Re: give items to killer if victim == special player
if(id) {
will NEVER proceed. There is no condition in that statement. but, yes, that's what you have to do to set that, assuming the context is right. |
Re: give items to killer if victim == special player
function is called.
|
| All times are GMT -4. The time now is 07:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.