Raised This Month: $ Target: $400
 0% 

[HELP] How do I loop set_task for only a few seconds.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-21-2018 , 13:36   Re: [HELP] How do I loop set_task for only a few seconds.
Reply With Quote #1

Why print the same data 9 times in chat. Wouldn't a HUD be better?
PHP Code:

#include <amxmodx>

new g_pFreezeTime;

public 
plugin_init() 
{
    
register_event"HLTV" "FreezeTimeStart" "a" "1=0" "2=0" );
    
    
g_pFreezeTime get_cvar_pointer"mp_freezetime" );
}

public 
FreezeTimeStart()
{
    
set_task1.0 "ShowInfo" , .flags="a" , .repeat=get_pcvar_numg_pFreezeTime ) );
}

public 
ShowInfo()
{
    
client_printprint_chat "freeze time data" );

__________________

Last edited by Bugsy; 04-21-2018 at 13:38.
Bugsy is offline
GoldNux
Senior Member
Join Date: Mar 2018
Old 04-21-2018 , 13:56   Re: [HELP] How do I loop set_task for only a few seconds.
Reply With Quote #2

Quote:
Originally Posted by Bugsy View Post
Why print the same data 9 times in chat. Wouldn't a HUD be better?
PHP Code:

#include <amxmodx>

new g_pFreezeTime;

public 
plugin_init() 
{
    
register_event"HLTV" "FreezeTimeStart" "a" "1=0" "2=0" );
    
    
g_pFreezeTime get_cvar_pointer"mp_freezetime" );
}

public 
FreezeTimeStart()
{
    
set_task1.0 "ShowInfo" , .flags="a" , .repeat=get_pcvar_numg_pFreezeTime ) );
}

public 
ShowInfo()
{
    
client_printprint_chat "freeze time data" );

I know this will sound stupid, but I don't like the HUD font.
I'm trying to keep my plugins in the background and have the server look as if it has not been tampered with.

Thank you for helping me out!
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731

Last edited by GoldNux; 04-21-2018 at 13:56.
GoldNux is offline
GoldNux
Senior Member
Join Date: Mar 2018
Old 04-21-2018 , 14:21   Re: [HELP] How do I loop set_task for only a few seconds.
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Why print the same data 9 times in chat. Wouldn't a HUD be better?
PHP Code:

#include <amxmodx>

new g_pFreezeTime;

public 
plugin_init() 
{
    
register_event"HLTV" "FreezeTimeStart" "a" "1=0" "2=0" );
    
    
g_pFreezeTime get_cvar_pointer"mp_freezetime" );
}

public 
FreezeTimeStart()
{
    
set_task1.0 "ShowInfo" , .flags="a" , .repeat=get_pcvar_numg_pFreezeTime ) );
}

public 
ShowInfo()
{
    
client_printprint_chat "freeze time data" );

Hm, can't get it to work.
It only prints when I have a single set_task.

Maybe I have to use show_hud...
This is what the code look like:

Code:
new g_pFreezeTime; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     g_pFreezeTime = get_cvar_pointer( "mp_freezetime" );     register_event("HLTV", "eventNewRound", "a", "1=0", "2=0")     register_cvar("gn_syncmoney", "0") } public FreezeTimeStart() {     new players[32];     new playercount, i;     get_players(players, playercount);     for (i=0; i<playercount; i++)     set_task( 1.0 , "updatePlayerEconomy" , .flags="a" , .repeat=get_pcvar_num( g_pFreezeTime ) ); } public updatePlayerEconomy(id) {     if (!is_user_hltv(id) && cs_get_user_team(id) == CS_TEAM_T || cs_get_user_team(id) == CS_TEAM_CT)     {         client_cmd(id,"say_team $ %d",cs_get_user_money(id))     } }
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731
GoldNux 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 04:39.


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