Raised This Month: $ Target: $400
 0% 

remove_task doesn't remove task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-04-2011 , 12:05   Re: remove_task doesn't remove task
Reply With Quote #1

Yes, I got such problem..... 4 days./

here working example how to set ID and remove it


PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"

#define TASK_MINMODELS 777

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("DeathMsg","hook_Death","a"); // For Death
   
}

public 
client_putinserver(plr)
{
    
set_task(5.0,"force_minmodels"plr TASK_MINMODELS)
}

public 
force_minmodels(plr)
{   
    
plr -= TASK_MINMODELS
    set_hudmessage
(20010000.05 0.8606.08.00.10.1, -1
    
show_hudmessage(0"  Rocket Launcher   ")
    
client_cmd(plr"cl_dlmax 120")
    
client_print(plrprint_center"Task is active")
}  

public 
hook_Death()
{
    new 
victim read_data(2);              
    
remove_task(victim TASK_MINMODELS);
     
client_print(victim,print_center,"remove task")

__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-04-2011 , 15:38   Re: remove_task doesn't remove task
Reply With Quote #2

Your working example is good on the task part but verry bad on everything else. It has slowhacking, bad client cvar understanding (cl_dlmax has nothing to do with models and you have no reason to change it !) and you're sending HUD message to everyone with useless spaces.

Still, he doesn't need to add task offsets in the IDs because he wants to remove both tasks it seems and that would do.

@m0skVi4a look at the example below and you also might want to add the "else" I'm adding here:
Code:
    if(Timer[id] < get_pcvar_num(g_max))  
    {  
        Timer[id] += 1  
        set_task(1.0, "TimerMain", id) // this task has "id" after it, those that don't need to in order to parse the correct ID number in this function
    }
    else // add these too :}
        StopTimer(id)
__________________
Hunter-Digital 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 01:30.


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