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
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 #1

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