Raised This Month: $51 Target: $400
 12% 

Help / Support Task zombies don't work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rybka
Member
Join Date: Dec 2011
Old 03-13-2012 , 15:42   Task zombies don't work
Reply With Quote #1

Could fix my plugin, than the this work? Ill be wait

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 03-14-2012 , 00:47   Re: Task zombies don't work
Reply With Quote #2

You need to pass the task arguments if the function has arguments.
Y060N 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 09:48.


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