Raised This Month: $51 Target: $400
 12% 

Solved How to use int args with handle timer function? (I can pay for solution)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
bayshades
Member
Join Date: Sep 2019
Old 10-14-2020 , 14:14   How to use int args with handle timer function? (I can pay for solution)
Reply With Quote #1

Okay guys here is my 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


#define OVERLAYPATH1 "overlays/holigan_hud3/count/zombie/1"   //Path to the overlay relative to materials/.. - no need for extentions like .vmt or .vft
#define OVERLAYPATH2 "overlays/holigan_hud3/count/zombie/2"
#define OVERLAYPATH3 "overlays/holigan_hud3/count/zombie/3"
#define OVERLAYPATH4 "overlays/holigan_hud3/count/zombie/4"
#define OVERLAYPATH5 "overlays/holigan_hud3/count/zombie/5"
#define OVERLAYPATH6 "overlays/holigan_hud3/count/zombie/6"
#define OVERLAYPATH7 "overlays/holigan_hud3/count/zombie/7"
#define OVERLAYPATH8 "overlays/holigan_hud3/count/zombie/8"
#define OVERLAYPATH9 "overlays/holigan_hud3/count/zombie/9"
#define OVERLAYPATH10 "overlays/holigan_hud3/count/zombie/10"


int iAmmount 30;

bool g_bTimerOn false;

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

public 
void OnMapStart()
{
    
PrecacheDecalAnyDownload(OVERLAYPATH10);   
}


public 
Action Event_RoundStart(Handle event, const char[] namebool dontBroadcast)
{
    
CreateTimer(1.0Timer_CountDown_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
    return 
Plugin_Continue;
}

public 
Action Timer_CountDown(Handle timerany data)
{
    if (
iAmmount == -1)
    {
        
g_bTimerOn false;
        return 
Plugin_Stop;
    }
    if (!
g_bTimerOn)
    {
        return 
Plugin_Stop;
    }
    if (
iAmmount == 10)
    {
        
ShowOverlayAll(OVERLAYPATH101.0);
        
iAmmount--;
    }
    else if (
iAmmount == 9)
    {
        
ShowOverlayAll(OVERLAYPATH91.0);
        
iAmmount--;
    }
    else if (
iAmmount == 8)
    {
        
ShowOverlayAll(OVERLAYPATH81.0);
        
iAmmount--;
    }
    else if (
iAmmount == 7)
    {
        
ShowOverlayAll(OVERLAYPATH71.0);
        
iAmmount--;
    }
    else if (
iAmmount == 6)
    {
        
ShowOverlayAll(OVERLAYPATH61.0);
        
iAmmount--;
    }
    else if (
iAmmount == 5)
    {
        
ShowOverlayAll(OVERLAYPATH51.0);
        
iAmmount--;
    }
    else if (
iAmmount == 4)
    {
        
ShowOverlayAll(OVERLAYPATH41.0);
        
iAmmount--;
    }
    else if (
iAmmount == 3)
    {
        
ShowOverlayAll(OVERLAYPATH31.0);
        
iAmmount--;
    }
    else if (
iAmmount == 2)
    {
        
ShowOverlayAll(OVERLAYPATH21.0);
        
iAmmount--;
    }
    else if (
iAmmount == 1)
    {
        
ShowOverlayAll(OVERLAYPATH11.0);
        
iAmmount--;
    }
    else if (
iAmmount == 0)
    {
        
        
iAmmount--;
    }
    else
    {
        
        
iAmmount--;
    }
    return 
Plugin_Continue;
}

public 
Action Command_TestOverlay(int clientint args)
{
    
ShowOverlayAll(OVERLAYPATH101.0);   

    return 
Plugin_Handled;

So sm_testoverlay works fine but Countdown is not working as you can see because ShowOverlayAll needs int client and int args but i couldnt use that two integer with public Action Timer_CountDown
i can pay for solution if its neccessary.

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



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 05:14.


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