Raised This Month: $32 Target: $400
 8% 

API Scripting Help Fix dead info for zombies?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rybka
Member
Join Date: Dec 2011
Old 03-13-2012 , 15:41   Fix dead info for zombies?
Reply With Quote #1

Hey guys can someone fix my code ? Task don't work =)
Code:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague> 

#define PLUGIN "Respawn Info"
#define VERSION "0.1"
#define AUTHOR "StefaN"

new countdown[33]

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_event("DeathMsg", "surv", "a")
}

public surv(){
        new zombiedead=read_data(2)
        if(zp_get_user_zombie(zombiedead)) set_task(0.5, "turncountdown", zombiedead)
}

public turncountdown(id)
{
        countdown[id] = 30    // Time to respawn
        
        if(task_exists(id + 3431))
        {
                remove_task(id + 3431)
        }
        set_task(1.0, "stop", id + 3431, _, _, "b")
        
        return PLUGIN_CONTINUE
}

public stop(gamemode, task_id)
{
        new id = task_id - 3431
        
        set_hudmessage(255, 255, 255, 0.03, 0.76, 2, 0.02, 1.0, 0.01)
        show_hudmessage(id, "Respawned for %d second...", countdown[id])
        countdown[id] -= 1 
        
        if(countdown[id] <= 0)
        {
                if(task_exists(task_id))
                {
                        remove_task(task_id)
                }
        }
}
rybka is offline
Y060N
BANNED
Join Date: Dec 2011
Location: www.equilibriumcs.com
Old 04-01-2012 , 02:55   Re: Fix dead info for zombies?
Reply With Quote #2

public stop(gamemode, task_id)

->

public stop(task_id)

Try that
Y060N is offline
rybka
Member
Join Date: Dec 2011
Old 04-17-2012 , 04:09   Re: Fix dead info for zombies?
Reply With Quote #3

Okay now work, but how to block countdown task iff be started a new round ?
Because, when a zombie is killed in the previous round and a new round will not stop the task and will continue to count down even though the zombie spawn a new round takes a zombie does not have =)

Second bug it - I will blocked info display in survivor mode coz, i didn't have respawns for this mode.

Srry again for bad english ...
rybka is offline
Reply



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:44.


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