Raised This Month: $61 Target: $400
 15% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bayshades
Junior 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
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-14-2020 , 14:33   Re: How to use int args with handle timer function? (I can pay for solution)
Reply With Quote #2

Timer_CountDown called on round start so you need to declare to which clients you want to show the overlay.
In order to show overlay to a specific client use:
ShowOverlay(int client, char[] path, float lifetime);
__________________
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 14:42.
SSheriFF is offline
bayshades
Junior Member
Join Date: Sep 2019
Old 10-14-2020 , 14:39   Re: How to use int args with handle timer function? (I can pay for solution)
Reply With Quote #3

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)
    {
        
ShowOverlay(clientOVERLAYPATH101.0); 
        
iAmmount--;
    }
    else if (
iAmmount == 9)
    {
        
ShowOverlay(clientOVERLAYPATH91.0);
        
iAmmount--;
    }
    else if (
iAmmount == 8)
    {
        
ShowOverlay(clientOVERLAYPATH81.0);
        
iAmmount--;
    }
    else if (
iAmmount == 7)
    {
        
ShowOverlay(clientOVERLAYPATH71.0);
        
iAmmount--;
    }
    else if (
iAmmount == 6)
    {
        
ShowOverlay(clientOVERLAYPATH61.0);
        
iAmmount--;
    }
    else if (
iAmmount == 5)
    {
        
ShowOverlay(clientOVERLAYPATH51.0);
        
iAmmount--;
    }
    else if (
iAmmount == 4)
    {
        
ShowOverlay(clientOVERLAYPATH41.0);
        
iAmmount--;
    }
    else if (
iAmmount == 3)
    {
        
ShowOverlay(clientOVERLAYPATH31.0);
        
iAmmount--;
    }
    else if (
iAmmount == 2)
    {
        
ShowOverlay(clientOVERLAYPATH21.0);
        
iAmmount--;
    }
    else if (
iAmmount == 1)
    {
        
ShowOverlay(clientOVERLAYPATH11.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;

ok i changed code but i tried that before. Can you show me to how to define symbol client?

Last edited by Sillium; 10-15-2020 at 00:20. Reason: Restore to previous version.
bayshades is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-14-2020 , 14:45   Re: How to use int args with handle timer function? (I can pay for solution)
Reply With Quote #4

Quote:
Originally Posted by bayshades View Post
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)
    {
        
ShowOverlay(clientOVERLAYPATH101.0); 
        
iAmmount--;
    }
    else if (
iAmmount == 9)
    {
        
ShowOverlay(clientOVERLAYPATH91.0);
        
iAmmount--;
    }
    else if (
iAmmount == 8)
    {
        
ShowOverlay(clientOVERLAYPATH81.0);
        
iAmmount--;
    }
    else if (
iAmmount == 7)
    {
        
ShowOverlay(clientOVERLAYPATH71.0);
        
iAmmount--;
    }
    else if (
iAmmount == 6)
    {
        
ShowOverlay(clientOVERLAYPATH61.0);
        
iAmmount--;
    }
    else if (
iAmmount == 5)
    {
        
ShowOverlay(clientOVERLAYPATH51.0);
        
iAmmount--;
    }
    else if (
iAmmount == 4)
    {
        
ShowOverlay(clientOVERLAYPATH41.0);
        
iAmmount--;
    }
    else if (
iAmmount == 3)
    {
        
ShowOverlay(clientOVERLAYPATH31.0);
        
iAmmount--;
    }
    else if (
iAmmount == 2)
    {
        
ShowOverlay(clientOVERLAYPATH21.0);
        
iAmmount--;
    }
    else if (
iAmmount == 1)
    {
        
ShowOverlay(clientOVERLAYPATH11.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;

ok i changed code but i tried that before. Can you show me to how to define symbol client?
To which clients you want to show the overlay?
__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
bayshades
Junior Member
Join Date: Sep 2019
Old 10-14-2020 , 14:56   Re: How to use int args with handle timer function? (I can pay for solution)
Reply With Quote #5

okay i ll try to declare all of users. but can u give me an example?
bayshades is offline
bayshades
Junior Member
Join Date: Sep 2019
Old 10-14-2020 , 14:58   Re: How to use int args with handle timer function? (I can pay for solution)
Reply With Quote #6

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)
{

    
int client GetClientOfUserId(client);

    if (
iAmmount == -1)
    {
        
g_bTimerOn false;
        return 
Plugin_Stop;
    }
    if (!
g_bTimerOn)
    {
        return 
Plugin_Stop;
    }
    if (
iAmmount == 10)
    {
        
ShowOverlay(clientOVERLAYPATH101.0); 
        
iAmmount--;
    }
    else if (
iAmmount == 9)
    {
        
ShowOverlay(clientOVERLAYPATH91.0);
        
iAmmount--;
    }
    else if (
iAmmount == 8)
    {
        
ShowOverlay(clientOVERLAYPATH81.0);
        
iAmmount--;
    }
    else if (
iAmmount == 7)
    {
        
ShowOverlay(clientOVERLAYPATH71.0);
        
iAmmount--;
    }
    else if (
iAmmount == 6)
    {
        
ShowOverlay(clientOVERLAYPATH61.0);
        
iAmmount--;
    }
    else if (
iAmmount == 5)
    {
        
ShowOverlay(clientOVERLAYPATH51.0);
        
iAmmount--;
    }
    else if (
iAmmount == 4)
    {
        
ShowOverlay(clientOVERLAYPATH41.0);
        
iAmmount--;
    }
    else if (
iAmmount == 3)
    {
        
ShowOverlay(clientOVERLAYPATH31.0);
        
iAmmount--;
    }
    else if (
iAmmount == 2)
    {
        
ShowOverlay(clientOVERLAYPATH21.0);
        
iAmmount--;
    }
    else if (
iAmmount == 1)
    {
        
ShowOverlay(clientOVERLAYPATH11.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;

ok i made it and compiled without an error let me try on my server thanks for your help

Last edited by Sillium; 10-15-2020 at 00:20. Reason: Restore to previous version.
bayshades is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-14-2020 , 14:58   Re: How to use int args with handle timer function? (I can pay for solution)
Reply With Quote #7

Quote:
Originally Posted by bayshades View Post
okay i ll try to declare all of users. but can u give me an example?
I dont understand you, Do you want to show the overlay to everyone?
__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
bayshades
Junior Member
Join Date: Sep 2019
Old 10-14-2020 , 15:03   Re: How to use int args with handle timer function? (I can pay for solution)
Reply With Quote #8

yes i want
bayshades is offline
bayshades
Junior Member
Join Date: Sep 2019
Old 10-14-2020 , 15:03   Re: How to use int args with handle timer function? (I can pay for solution)
Reply With Quote #9

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.

Last edited by bayshades; 10-14-2020 at 15:14.
bayshades is offline
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
Reply


Thread Tools
Display Modes

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 13:53.


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