|
AlliedModders Donor
Join Date: May 2020
Location: Israel
|
10-14-2020
, 14:45
Re: How to use int args with handle timer function? (I can pay for solution)
|
#4
|
Quote:
Originally Posted by bayshades
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[] name, bool dontBroadcast)
{
CreateTimer(1.0, Timer_CountDown, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
return Plugin_Continue;
}
public Action Timer_CountDown(Handle timer, any data)
{
if (iAmmount == -1)
{
g_bTimerOn = false;
return Plugin_Stop;
}
if (!g_bTimerOn)
{
return Plugin_Stop;
}
if (iAmmount == 10)
{
ShowOverlay(client, OVERLAYPATH10, 1.0);
iAmmount--;
}
else if (iAmmount == 9)
{
ShowOverlay(client, OVERLAYPATH9, 1.0);
iAmmount--;
}
else if (iAmmount == 8)
{
ShowOverlay(client, OVERLAYPATH8, 1.0);
iAmmount--;
}
else if (iAmmount == 7)
{
ShowOverlay(client, OVERLAYPATH7, 1.0);
iAmmount--;
}
else if (iAmmount == 6)
{
ShowOverlay(client, OVERLAYPATH6, 1.0);
iAmmount--;
}
else if (iAmmount == 5)
{
ShowOverlay(client, OVERLAYPATH5, 1.0);
iAmmount--;
}
else if (iAmmount == 4)
{
ShowOverlay(client, OVERLAYPATH4, 1.0);
iAmmount--;
}
else if (iAmmount == 3)
{
ShowOverlay(client, OVERLAYPATH3, 1.0);
iAmmount--;
}
else if (iAmmount == 2)
{
ShowOverlay(client, OVERLAYPATH2, 1.0);
iAmmount--;
}
else if (iAmmount == 1)
{
ShowOverlay(client, OVERLAYPATH1, 1.0);
iAmmount--;
}
else if (iAmmount == 0)
{
iAmmount--;
}
else
{
iAmmount--;
}
return Plugin_Continue;
}
public Action Command_TestOverlay(int client, int args)
{
ShowOverlayAll(OVERLAYPATH10, 1.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:
|
|
|
|