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

[Help] set_task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 12-31-2016 , 11:11   [Help] set_task
Reply With Quote #1

I already know how to do this.
__________________

Last edited by Relaxing; 03-30-2018 at 18:49.
Relaxing is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 12-31-2016 , 11:39   Re: [Help] set_task
Reply With Quote #2

I guess this should be in the Scripting Help.

http://amxmodx.org/api/amxmodx/set_task
What exactly do you not understand here? As for examples (on how to call it), you can look at other plugins or dozens of topics about set_task.
klippy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 12-31-2016 , 11:46   Re: [Help] set_task
Reply With Quote #3

It's in the right section, it's a request.

Description

Quote:
Calls a function after a specified time has elapsed.
Syntax

Quote:
native set_task(Float:time, const function[], id = 0, const any:parameter[] = "", len = 0, const flags[] = "", repeat = 0);
Example :

This will create a repeatable task which will be called every 5 seconds and will check if user isn't alive, if true he will be respawned

PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init() {
    
register_plugin("test""1.0""some white guy")
    
register_clcmd("say /createtask""create_task")
}

public 
create_task(id) { 
    
    
set_task(5.0"make_a_repeatable_task"id__"b")
    
}

public 
make_a_repeatable_task(id) {
    
    if(!(
is_user_alive(id))) {
        
ExecuteHamB(Ham_CS_RoundRespawnid)
    }

__________________

Last edited by edon1337; 12-31-2016 at 11:47.
edon1337 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-31-2016 , 17:11   Re: [Help] set_task
Reply With Quote #4

Quote:
Originally Posted by edon1337 View Post
It's in the right section, it's a request.
The Suggestions/Requests forum is for suggesting and requesting plugins. Questions about code should be in Scripting Help since it is a question about scripting.
__________________
fysiks 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:23.


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