Raised This Month: $ Target: $400
 0% 

Jumpkick Worldspawn Kill Detection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheFrozenFire
Junior Member
Join Date: Jun 2010
Old 06-16-2010 , 00:33   Jumpkick Worldspawn Kill Detection
Reply With Quote #1

Hello

I'm trying to modify the Jumpkick plugin by Hawk552, in order to have it account for kills induced by jumpkicking a player into the ground, or into a hazard.

To achieve this, my idea was to have an array which keeps track, by player ID, which player has jumpkicked each player last. I also set a task to zero out the element for each player after a set number of seconds (so that if a player kills themself, the last player doesn't always get the kill).

A function is then registered to DeathMsg, filtered with the KillerID being 0, and the weapon being worldspawn. This function checks the tracking array to see if the victim is associated with an attacker, and if it is, it registers the death as a kill for the respective attacker.

For some reason, this method isn't working. The modified plugin compiles fine, and loads fine, but kills are not registering.

Here is a diff of my edits to the current Jumpkick plugin:
Code:
6a7
> new attackerID[33];
17a19,20
>     register_cvar("amx_jumpkick_world", "1");
>     register_cvar("amx_jumpkick_worldtime", "3.0");
19a23,24
>     register_event("DeathMsg", "worldKill", "a", "1=0", "4=worldspawn");
>     
50a56,60
>             if(get_cvar_num("amx_jumpkick_world") == 1) {
>                 remove_task(ent);
>                 attackerID[ent] = id;
>                 set_task(get_cvar_float("amx_jumpkick_worldtime"),"worldKillUnset",ent);
>             }
58d67
< 
97a107,122
> public worldKill()
> {
>     new victim = get_msg_arg_int(2);
>     if(attackerID[victim] == 0) return PLUGIN_CONTINUE;
>     
>     createKill(victim, attackerID[victim], "Jumpkick Against Ground");
>     worldKillUnset(victim);
>     return PLUGIN_CONTINUE;
> }
> 
> public worldKillUnset(id)
> {
>     attackerID[id] = 0;
>     return 0;
> }
>
I just started with Pawn and AMXX, so forgive me if anything is blatantly silly. I've been coding in PHP and C for several years now, so I'm competent in most regards, but AMXX is substantially different from the environment I'm accustomed to.
Attached Files
File Type: sma Get Plugin or Get Source (jumpkick_withworld.sma - 570 views - 5.5 KB)

Last edited by TheFrozenFire; 06-16-2010 at 01:22.
TheFrozenFire is offline
Reply


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


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