View Single Post
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-14-2020 , 15:16   Re: How to use int args with handle timer function? (I can pay for solution)
Reply With Quote #10

Quote:
Originally Posted by bayshades View Post
the last code that i ve sent. i compiled it fine but it didnt work on server.
All I want is show overlays to everyone after 20 seconds when round started.
like a countdown with overlays. each overlay will be showen for 1 sec to everyone.
That should work, also I cleaned some parts on this code.
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 30;
    
CreateTimer(1.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;

__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:

Last edited by SSheriFF; 10-14-2020 at 15:20.
SSheriFF is offline