View Single Post
bayshades
Member
Join Date: Sep 2019
Old 10-14-2020 , 15:37   Re: How to use int args with handle timer function? (I can pay for solution)
Reply With Quote #14

PHP Code:
#include <sourcemod>
#include <sdktools>   //need for adding files to download table

#include <overlays>


//Compiler Options   //Optional, but please keep your code clean!
#pragma semicolon 1
#pragma newdecls required


int iAmmount;

public 
void OnPluginStart()
{
    
HookEvent("round_start"Event_RoundStart);
    
RegConsoleCmd("sm_testoverlay"Command_TestOverlay"Show overlay to client");
}

public 
void OnMapStart()
{
    for (
int i 111;i++)
    {
        
char path[128];
        
Format(path128"overlays/holigan_hud3/count/zombie/%d"i);
        
PrecacheDecalAnyDownload(path);   
    }
}

public 
Action Event_RoundStart(Handle event, const char[] namebool dontBroadcast)
{
    
iAmmount 10;
    
CreateTimer(20.0Timer_CountDown_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action Timer_CountDown(Handle timerany data)
{
    if (
iAmmount == 0)
        return 
Plugin_Stop;
    else if(
iAmmount<=10)
    {
        
char path[128];
        
Format(path128"overlays/holigan_hud3/count/zombie/%d"iAmmount);
        
ShowOverlayAll(path1.0);
    }
     
iAmmount--;
    return 
Plugin_Continue;
}

public 
Action Command_TestOverlay(int clientint args)
{
    
ShowOverlayAll("overlays/holigan_hud3/count/zombie/10"1.0);   

    return 
Plugin_Handled;

Okay i change iAmount to 10 and changed timer to 20. Overlay 10 is working but other overlays not.

Last edited by Sillium; 10-15-2020 at 00:19. Reason: Restore to previous version.
bayshades is offline