Raised This Month: $ Target: $400
 0% 

[Question]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Akka3223
Member
Join Date: Oct 2016
Old 02-28-2017 , 12:13   [Question]
Reply With Quote #1

Is there any command that can repeat script every 10min

Like i need to repeat this script every 10mins:

Code:
} public round_start() {   new ent = FM_NULLENT static string_class[] = "classname" while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, item_class_name)))     {     set_pev(ent, pev_effects, 0)     set_pev(ent, pev_solid, SOLID_BBOX)     } }
Akka3223 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-28-2017 , 12:17   Re: [Question]
Reply With Quote #2

Yes, u can use set_task and make it repeat every 10 minutes. Tha means 600.0 seconds

Do it like that : set_task(600.0, "taskname",_,_,_,"b") and then on the public taskname put your code.

Last edited by DarthMan; 02-28-2017 at 12:17.
DarthMan is offline
Akka3223
Member
Join Date: Oct 2016
Old 02-28-2017 , 12:31   Re: [Question]
Reply With Quote #3

Quote:
Originally Posted by DarthMan View Post
Yes, u can use set_task and make it repeat every 10 minutes. Tha means 600.0 seconds

Do it like that : set_task(600.0, "taskname",_,_,_,"b") and then on the public taskname put your code.
can you give me example of public taskname?
Akka3223 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-28-2017 , 12:40   Re: [Question]
Reply With Quote #4

Quote:
Originally Posted by Akka3223 View Post
can you give me example of public taskname?
On public_init add this line set_task(600.0, "taskname",_,_,_,"b"); and then:

Code:
public taskname(id)
{
      //put your code here
}
Replace taskname with anything you'd like
DarthMan is offline
Akka3223
Member
Join Date: Oct 2016
Old 02-28-2017 , 12:50   Re: [Question]
Reply With Quote #5

got it ty

Last edited by Akka3223; 02-28-2017 at 12:58.
Akka3223 is offline
Akka3223
Member
Join Date: Oct 2016
Old 02-28-2017 , 13:08   Re: [Question]
Reply With Quote #6

dude >
Code:
//// Dzzpres.sma // C:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\Dzzpres.sma(296) : error 010: invalid function or declaration // C:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\Dzzpres.sma(340) : warning 203: symbol is never used: "ent" // C:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\Dzzpres.sma(340) : warning 203: symbol is never used: "string_class"

Code:
} public round_start() {       set_task(30.0, "round_start",_,_,_,"b") } new ent = FM_NULLENT static string_class[] = "classname" while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, item_class_name)))     {     set_pev(ent, pev_effects, 0)     set_pev(ent, pev_solid, SOLID_BBOX)     client_print(0, print_chat, "Cubes has been spawned!.")     } }

Last edited by Akka3223; 02-28-2017 at 13:09.
Akka3223 is offline
Old 02-28-2017, 13:14
OciXCrom
This message has been deleted by OciXCrom.
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 02-28-2017 , 13:16   Re: [Question]
Reply With Quote #7

@Akka3223

what you excatly trying to do?

why you using 30 sec from start round?

I do not see any Public. So it does have problems with ENT

maybe
Code:
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    set_task(600.0, "taskname",_,_,_,"b") // 10 minute
}

public taskname(id)
{
    new ent = FM_NULLENT
    static string_class[] = "classname"
    while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, item_class_name)))
    {
        set_pev(ent, pev_effects, 0)
        set_pev(ent, pev_solid, SOLID_BBOX)
        client_print(0, print_chat, "Cubes has been spawned!.")
    }
}
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-28-2017 , 13:19   Re: [Question]
Reply With Quote #8

Code:
#include <amxmodx> #include <fakemeta> #include <engine> #define TIME_TASK 30.0 public plugin_init() {     set_task(TIME_TASK, "task_repeat", 0, _, _, "b") } public task_repeat() {         new ent = -1     while ((ent = find_ent_by_class(ent, "classname")))     {         set_pev(ent, pev_effects, 0)         set_pev(ent, pev_solid, SOLID_BBOX)         client_print(0, print_chat, "Cubes has been spawned!.")     } }
__________________
edon1337 is offline
Akka3223
Member
Join Date: Oct 2016
Old 02-28-2017 , 13:21   Re: [Question]
Reply With Quote #9

Quote:
Originally Posted by Fuck For Fun View Post
@Akka3223

what you excatly trying to do?

why you using 30 sec from start round?

I do not see any Public. So it does have problems with ENT

maybe
Code:
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    set_task(600.0, "taskname",_,_,_,"b") // 10 minute
}

public taskname(id)
{
    new ent = FM_NULLENT
    static string_class[] = "classname"
    while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, item_class_name)))
    {
        set_pev(ent, pev_effects, 0)
        set_pev(ent, pev_solid, SOLID_BBOX)
        client_print(0, print_chat, "Cubes has been spawned!.")
    }
}
round_start is a menu command that respawns my cubes
Akka3223 is offline
Akka3223
Member
Join Date: Oct 2016
Old 02-28-2017 , 13:28   Re: [Question]
Reply With Quote #10

Quote:
Originally Posted by edon1337 View Post
Code:
#include <amxmodx> #include <fakemeta> #include <engine> #define TIME_TASK 30.0 public plugin_init() {     set_task(TIME_TASK, "task_repeat", 0, _, _, "b") } public task_repeat() {         new ent = -1     while ((ent = find_ent_by_class(ent, "classname")))     {         set_pev(ent, pev_effects, 0)         set_pev(ent, pev_solid, SOLID_BBOX)         client_print(0, print_chat, "Cubes has been spawned!.")     } }
even more bugging



public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_forward(FM_Touch, "fwd_Touch")

register_event("HLTV", "round_start", "a", "1=0", "2=0")

register_clcmd("dm_menu", "display_items_menu")

g_Menu = menu_create("DM Item's Menu","menu_item")

set_task(TIME_TASK, "task_repeat", 0, _, _, "b")
} <----------- MUST?

Last edited by Akka3223; 02-28-2017 at 13:29.
Akka3223 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 21:04.


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