Raised This Month: $32 Target: $400
 8% 

[CSGO] entity_prop_stocks errors when compiling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DGVaniX
Junior Member
Join Date: Jan 2021
Old 01-25-2021 , 16:28   [CSGO] entity_prop_stocks errors when compiling
Reply With Quote #1

Hi,
I've recently started an Arena CSGO server and I'm trying to learn SP.

I've noticed that a lot of plugins throw the following errors when compilying:

Code:
// C:\Users\Administrator\Desktop\CSGOArena\server\csgo\addons\sourcemod\scripting\include\entity_prop_stocks.inc(179) : error 001: expected token: "(", but found "-identifier-"
// C:\Users\Administrator\Desktop\CSGOArena\server\csgo\addons\sourcemod\scripting\include\entity_prop_stocks.inc(179) : error 001: expected token: ";", but found "("
// C:\Users\Administrator\Desktop\CSGOArena\server\csgo\addons\sourcemod\scripting\include\entity_prop_stocks.inc(192) : error 001: expected token: "(", but found "-identifier-"
// C:\Users\Administrator\Desktop\CSGOArena\server\csgo\addons\sourcemod\scripting\include\entity_prop_stocks.inc(192) : error 001: expected token: ";", but found "("
// C:\Users\Administrator\Desktop\CSGOArena\server\csgo\addons\sourcemod\scripting\include\entity_prop_stocks.inc(202) : error 021: symbol already defined: "MoveType"
// C:\Users\Administrator\Desktop\CSGOArena\server\csgo\addons\sourcemod\scripting\include\entity_prop_stocks.inc(202) : error 010: invalid function or declaration
// C:\Users\Administrator\Desktop\CSGOArena\server\csgo\addons\sourcemod\scripting\include\entity_prop_stocks.inc(202 -- 204) : error 001: expected token: ";", but found "-identifier-"
// C:\Users\Administrator\Desktop\CSGOArena\server\csgo\addons\sourcemod\scripting\include\entity_prop_stocks.inc(202 -- 204) : fatal error 127: too many error messages on one line
I've tried updating the .inc file with the one on the API wiki but still the same thing.

Anyone know what's up?

Thanks

Last edited by DGVaniX; 01-25-2021 at 16:28.
DGVaniX is offline
FroGeX
Senior Member
Join Date: Aug 2020
Old 01-26-2021 , 05:55   Re: [CSGO] entity_prop_stocks errors when compiling
Reply With Quote #2

We need see your code

Last edited by FroGeX; 01-26-2021 at 05:56.
FroGeX is offline
DGVaniX
Junior Member
Join Date: Jan 2021
Old 01-26-2021 , 17:09   Re: [CSGO] entity_prop_stocks errors when compiling
Reply With Quote #3

Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <clientprefs>

public Plugin myinfo = 
{
	name = "CSGO HUD",
	author = "xSLOW",
	description = "CSGO HUD",
	version = "3.0"
};

enum {
	RED = 0,
	GREEN,
	BLUE
}

ConVar g_cvarMessage1, g_cvarHUDColors, g_cvarAds, \
        g_cvarTimeHeld, g_cvarTimeBetweenAds, g_cvarEffectType, g_cvarEffectDuration, g_cvarFadeInDuration, \
         g_cvarFadeOutDuration, g_cvarHudStyle;

Handle g_hHUDv2Cookie, gh_SyncHUD = null, gh_SyncHUD_Ads = null;
bool g_bIsHudEnabled[MAXPLAYERS + 1], g_bMapHasTimeLimit = false;
int g_iHUDColors[3], g_iMapTimeLimit, g_iAdsAmt, g_iNextMessage;
char g_sAds[1024], g_cCurrentMessage[128], g_cParts[16][128], g_iMessage1[128];
float g_fTimeHeld;

public void OnPluginStart()
{
	g_hHUDv2Cookie = RegClientCookie("csgo_hud", "csgo_hud", CookieAccess_Protected);

	g_cvarMessage1 = CreateConVar("sm_hud_message1", "MESSAGE 1", "Top-Left first message", FCVAR_NOTIFY);
	g_cvarHUDColors = CreateConVar("sm_hud_rgb", "0,102,204", "RGB of the text. You can get more colors from https://www.hexcolortool.com/", FCVAR_NOTIFY);
	g_cvarHudStyle = CreateConVar("sm_hud_style", "1", "1 = Top Left on screen (where the radar is) and 2 = Bottom Mid on screen");

	g_cvarAds = CreateConVar("sm_hud_Ads", "First;Second;Third;Fourth", "Defines all Ads, separated by semicolons.");
	g_cvarTimeHeld = CreateConVar("sm_hud_timeheld", "2.0", "Amount of time in seconds Ads are held.");
	g_cvarTimeBetweenAds = CreateConVar("sm_hud_timebetweenAds", "2.0", "Amount of time in seconds between Ads.");	
	g_cvarEffectType = CreateConVar("sm_hud_effect_type", "1.0", "0 - Fade In; 1 - Fade out; 2 - Flash", _, true, 0.0, true, 2.0);
	g_cvarEffectDuration = CreateConVar("sm_hud_effect_duration", "0.5", "Duration of the selected effect. Not always aplicable");
	g_cvarFadeInDuration = CreateConVar("sm_hud_fadein_duration", "0.5", "Duration of the selected effect.");
	g_cvarFadeOutDuration = CreateConVar("sm_hud_fadeout_duration", "0.5", "Duration of the selected effect.");
	Format(g_sAds, sizeof(g_sAds), "");

	AutoExecConfig(true, "csgo_hud");

	UpdateHUDColor();
	g_cvarHUDColors.AddChangeHook(cvarChanged_HUDColor);

	CreateTimer(3.0, Timer_Hud, _, TIMER_REPEAT);

	RegConsoleCmd("hud", Command_hud);
    
        for(int i = 1; i <= MaxClients; i++)
            EnableHoodini(i);

	gh_SyncHUD = CreateHudSynchronizer();
	gh_SyncHUD_Ads = CreateHudSynchronizer();
}

public void OnMapStart()
{
	g_bMapHasTimeLimit = false;
	GetMapTimeLimit(g_iMapTimeLimit);
	if(g_iMapTimeLimit > 0)
		g_bMapHasTimeLimit = true;

	g_cvarMessage1.GetString(g_iMessage1, sizeof(g_iMessage1));
}

public void OnPluginEnd()
{
	CloseHandle(gh_SyncHUD);
	CloseHandle(gh_SyncHUD_Ads);
}

public void OnConfigsExecuted() 
{
	GetConVarString(g_cvarAds, g_sAds, sizeof(g_sAds));
	Format(g_sAds, sizeof(g_sAds), "%s", g_sAds);
	g_iAdsAmt = ExplodeString(g_sAds, ";", g_cParts, sizeof(g_cParts), sizeof(g_cParts[]));
	float timeBetweenAds = GetConVarFloat(g_cvarTimeBetweenAds);
	g_fTimeHeld = GetConVarFloat(g_cvarTimeHeld);
	g_iNextMessage = 0;
	CreateTimer(g_fTimeHeld + timeBetweenAds, Timer_Ads, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

void EnableHoodini(int client)
{
	if(AreClientCookiesCached(client) && IsClientValid(client))
	{
    	g_bIsHudEnabled[client] = false;
    	char buffer[64];
    	GetClientCookie(client, g_hHUDv2Cookie, buffer, sizeof(buffer));
    	if(StrEqual(buffer,"1"))
		    g_bIsHudEnabled[client] = true;
	}
}

public void OnClientPostAdminCheck(int client)
{
	EnableHoodini(client);
}

public void OnClientCookiesCached(int client)
{
	EnableHoodini(client);
}

public void cvarChanged_HUDColor(ConVar convar, const char[] oldValue, const char[] newValue) {
	UpdateHUDColor();
}

public Action Command_hud(int client, int args) 
{
	if(g_bIsHudEnabled[client])
	{
		PrintToChat(client, " ★ \x02HUD is now off");
		g_bIsHudEnabled[client] = false;
		SetClientCookie(client, g_hHUDv2Cookie, "0");
	}
	else
	{
		PrintToChat(client, " ★ \x04HUD is now on");
		g_bIsHudEnabled[client] = true;
		SetClientCookie(client, g_hHUDv2Cookie, "1");
	}
}


public Action Timer_Hud(Handle timer, any client)
{
	int clientCount = 0, iTimeleft;
	char sTime[64], szTime[30], MapTimeLeft[128], iBuffer[1024];
	
	for (int i = 1; i <= MaxClients; i++)
	{
		if (IsClientInGame(i) && !IsFakeClient(i))
			++clientCount;
	}

	GetMapTimeLeft(iTimeleft);
	FormatTime(szTime, sizeof(szTime), "%H:%M:%S", GetTime());
	FormatTime(sTime, sizeof(sTime), "%M:%S", iTimeleft);

	for(int i = 1; i <= MaxClients; i++)
	{
		if(g_bIsHudEnabled[i] && IsClientValid(i))
		{
			if(g_cvarHudStyle.IntValue == 1)
			{
				if(g_bMapHasTimeLimit)
				{
					if(!(iTimeleft > 0))
						Format(MapTimeLeft,sizeof(MapTimeLeft), "Ultima Runda");
					else
						Format(MapTimeLeft,sizeof(MapTimeLeft), "%s", sTime);
 
					Format(iBuffer, sizeof(iBuffer),"%s\Jucatori: %d/%d\nTimeleft: %s\nOra: %s",g_iMessage1, clientCount, GetMaxHumanPlayers(), MapTimeLeft, szTime);
					SetHudTextParams(0.0, 0.0, 5.2, g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 255, 0, 0.0, 0.0, 0.0);  
					ShowSyncHudText(i, gh_SyncHUD, iBuffer);
				}
				else
				{
					Format(iBuffer, sizeof(iBuffer),"%s\Jucatori: %d/%d\Ora: %s",g_iMessage1, clientCount, GetMaxHumanPlayers(), szTime);
					SetHudTextParams(0.0, 0.0, 5.2, g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 255, 0, 0.0, 0.0, 0.0);  
					ShowSyncHudText(i, gh_SyncHUD, iBuffer);
				}
			}
			else if(g_cvarHudStyle.IntValue == 2)
			{
				if(g_bMapHasTimeLimit)
				{
					if(!(iTimeleft > 0))
						Format(MapTimeLeft,sizeof(MapTimeLeft), "Ultima Runda");
					else
						Format(MapTimeLeft,sizeof(MapTimeLeft), "%s", sTime);

					Format(iBuffer, sizeof(iBuffer),"Jucatori: %d/%d\nTimp Ramas: %s\nOra: %s\n%s", clientCount, GetMaxHumanPlayers(), MapTimeLeft, szTime, g_iMessage1);
					SetHudTextParams(-1.0, 1.0, 5.2, g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 255, 0, 0.0, 0.0, 0.0);  
					ShowSyncHudText(i, gh_SyncHUD, iBuffer);
				}
				else
				{
					Format(iBuffer, sizeof(iBuffer),"Jucatori: %d/%d\nOra: %s\n%s", clientCount, GetMaxHumanPlayers(), szTime, g_iMessage1);
					SetHudTextParams(-1.0, 1.0, 5.2, g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 255, 0, 0.0, 0.0, 0.0);  
					ShowSyncHudText(i, gh_SyncHUD, iBuffer);
				}
			}
        }
        if(!g_bIsHudEnabled[i] && IsClientValid(i))
        {
            Format(iBuffer, sizeof(iBuffer),"%s", g_iMessage1);
            SetHudTextParams(-1.0, 0.075, 5.2, g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 255, 0, 0.0, 0.0, 0.0);
            ShowSyncHudText(i, gh_SyncHUD, iBuffer);
        }
	}
}


public Action Timer_Ads(Handle timer)
{
    Format(g_cCurrentMessage, sizeof(g_cCurrentMessage), g_cParts[g_iNextMessage]);

    int effect = GetConVarInt(g_cvarEffectType);
    float effectDuration = GetConVarFloat(g_cvarEffectDuration);
    float fadeIn = GetConVarFloat(g_cvarFadeInDuration);
    float fadeOut = GetConVarFloat(g_cvarFadeOutDuration);
    int iRED = GetRandomInt(0,255);
    int iGREEN = GetRandomInt(0,255);
    int iBLUE = GetRandomInt(0,255);	

    for(int i = 1; i <= MaxClients; i++)
	{
		if(IsClientValid(i))
		{
			if(g_cvarHudStyle.IntValue == 1)
			{
                if(g_bIsHudEnabled[i])
                {
                    SetHudTextParams(-1.0, 0.075, g_fTimeHeld, iRED, iGREEN, iBLUE, 255, effect, effectDuration, fadeIn, fadeOut);
                    ShowSyncHudText(i, gh_SyncHUD_Ads, g_cCurrentMessage);  
                }
                else if(!g_bIsHudEnabled[i])
                {
				    SetHudTextParams(-1.0, 1.0, g_fTimeHeld, iRED, iGREEN, iBLUE, 255, effect, effectDuration, fadeIn, fadeOut);
				    ShowSyncHudText(i, gh_SyncHUD_Ads, g_cCurrentMessage);
                }
			}
			else if(g_cvarHudStyle.IntValue == 2)
			{
                if(g_bIsHudEnabled[i])
                {
                    SetHudTextParams(-1.0, 0.075, g_fTimeHeld, iRED, iGREEN, iBLUE, 255, effect, effectDuration, fadeIn, fadeOut);
                    ShowSyncHudText(i, gh_SyncHUD_Ads, g_cCurrentMessage);  
                }
                else if(!g_bIsHudEnabled[i])
                {
				    SetHudTextParams(-1.0, 1.0, g_fTimeHeld, iRED, iGREEN, iBLUE, 255, effect, effectDuration, fadeIn, fadeOut);
				    ShowSyncHudText(i, gh_SyncHUD_Ads, g_cCurrentMessage);
                }
			}
		}
	}
    if (g_iNextMessage != g_iAdsAmt - 1) {
		g_iNextMessage++;
	}
	else
	{
		g_iNextMessage = 0;
	}
}

bool IsClientValid(int client)
{
    return (0 < client <= MaxClients) && IsClientInGame(client) && !IsFakeClient(client);
}

void UpdateHUDColor() {
	char buffer[16];
	g_cvarHUDColors.GetString(buffer, sizeof(buffer));

	char buffer2[3][4];
	ExplodeString(buffer, ",", buffer2, sizeof(buffer2), sizeof(buffer2[]));
	
	for (int i = 0; i < 3; i++) {
		g_iHUDColors[i] = StringToInt(buffer2[i]);
	}
}
Its not just this, its multiple plugins that throw the same errors, but this is the one I tried to compile just now to test
DGVaniX is offline
FroGeX
Senior Member
Join Date: Aug 2020
Old 01-27-2021 , 04:28   Re: [CSGO] entity_prop_stocks errors when compiling
Reply With Quote #4

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <clientprefs>

public Plugin myinfo =
{
    
name "CSGO HUD",
    
author "xSLOW",
    
description "CSGO HUD",
    
version "3.0"
};

enum {
    
RED 0,
    
GREEN,
    
BLUE
}

ConVar g_cvarMessage1g_cvarHUDColorsg_cvarAds, \
        
g_cvarTimeHeldg_cvarTimeBetweenAdsg_cvarEffectTypeg_cvarEffectDurationg_cvarFadeInDuration, \
         
g_cvarFadeOutDurationg_cvarHudStyle;

Handle g_hHUDv2Cookiegh_SyncHUD nullgh_SyncHUD_Ads null;
bool g_bIsHudEnabled[MAXPLAYERS 1], g_bMapHasTimeLimit false;
int g_iHUDColors[3], g_iMapTimeLimitg_iAdsAmtg_iNextMessage;
char g_sAds[1024], g_cCurrentMessage[128], g_cParts[16][128], g_iMessage1[128];
float g_fTimeHeld;

public 
void OnPluginStart()
{
    
g_hHUDv2Cookie RegClientCookie("csgo_hud""csgo_hud"CookieAccess_Protected);

    
g_cvarMessage1 CreateConVar("sm_hud_message1""MESSAGE 1""Top-Left first message"FCVAR_NOTIFY);
    
g_cvarHUDColors CreateConVar("sm_hud_rgb""0,102,204""RGB of the text. You can get more colors from https://www.hexcolortool.com/"FCVAR_NOTIFY);
    
g_cvarHudStyle CreateConVar("sm_hud_style""1""1 = Top Left on screen (where the radar is) and 2 = Bottom Mid on screen");

    
g_cvarAds CreateConVar("sm_hud_Ads""First;Second;Third;Fourth""Defines all Ads, separated by semicolons.");
    
g_cvarTimeHeld CreateConVar("sm_hud_timeheld""2.0""Amount of time in seconds Ads are held.");
    
g_cvarTimeBetweenAds CreateConVar("sm_hud_timebetweenAds""2.0""Amount of time in seconds between Ads.");
    
g_cvarEffectType CreateConVar("sm_hud_effect_type""1.0""0 - Fade In; 1 - Fade out; 2 - Flash"_true0.0true2.0);
    
g_cvarEffectDuration CreateConVar("sm_hud_effect_duration""0.5""Duration of the selected effect. Not always aplicable");
    
g_cvarFadeInDuration CreateConVar("sm_hud_fadein_duration""0.5""Duration of the selected effect.");
    
g_cvarFadeOutDuration CreateConVar("sm_hud_fadeout_duration""0.5""Duration of the selected effect.");
    
Format(g_sAdssizeof(g_sAds), "");

    
AutoExecConfig(true"csgo_hud");

    
UpdateHUDColor();
    
g_cvarHUDColors.AddChangeHook(cvarChanged_HUDColor);

    
CreateTimer(3.0Timer_Hud_TIMER_REPEAT);

    
RegConsoleCmd("hud"Command_hud);

        for(
int i 1<= MaxClientsi++)
            
EnableHoodini(i);

    
gh_SyncHUD CreateHudSynchronizer();
    
gh_SyncHUD_Ads CreateHudSynchronizer();
}

public 
void OnMapStart()
{
    
g_bMapHasTimeLimit false;
    
GetMapTimeLimit(g_iMapTimeLimit);
    if(
g_iMapTimeLimit 0)
        
g_bMapHasTimeLimit true;

    
g_cvarMessage1.GetString(g_iMessage1sizeof(g_iMessage1));
}

public 
void OnPluginEnd()
{
    
CloseHandle(gh_SyncHUD);
    
CloseHandle(gh_SyncHUD_Ads);
}

public 
void OnConfigsExecuted()
{
    
GetConVarString(g_cvarAdsg_sAdssizeof(g_sAds));
    
Format(g_sAdssizeof(g_sAds), "%s"g_sAds);
    
g_iAdsAmt ExplodeString(g_sAds";"g_cPartssizeof(g_cParts), sizeof(g_cParts[]));
    
float timeBetweenAds GetConVarFloat(g_cvarTimeBetweenAds);
    
g_fTimeHeld GetConVarFloat(g_cvarTimeHeld);
    
g_iNextMessage 0;
    
CreateTimer(g_fTimeHeld timeBetweenAdsTimer_Ads_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

void EnableHoodini(int client)
{
    if(
AreClientCookiesCached(client) && IsClientValid(client))
    {
        
g_bIsHudEnabled[client] = false;
        
char buffer[64];
        
GetClientCookie(clientg_hHUDv2Cookiebuffersizeof(buffer));
        if(
StrEqual(buffer,"1"))
            
g_bIsHudEnabled[client] = true;
    }
}

public 
void OnClientPostAdminCheck(int client)
{
    
EnableHoodini(client);
}

public 
void OnClientCookiesCached(int client)
{
    
EnableHoodini(client);
}

public 
void cvarChanged_HUDColor(ConVar convar, const char[] oldValue, const char[] newValue) {
    
UpdateHUDColor();
}

public 
Action Command_hud(int clientint args)
{
    if(
g_bIsHudEnabled[client])
    {
        
PrintToChat(client" ★ \x02HUD is now off");
        
g_bIsHudEnabled[client] = false;
        
SetClientCookie(clientg_hHUDv2Cookie"0");
    }
    else
    {
        
PrintToChat(client" ★ \x04HUD is now on");
        
g_bIsHudEnabled[client] = true;
        
SetClientCookie(clientg_hHUDv2Cookie"1");
    }
}


public 
Action Timer_Hud(Handle timerany client)
{
    
int clientCount 0iTimeleft;
    
char sTime[64], szTime[30], MapTimeLeft[128], iBuffer[1024];

    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && !IsFakeClient(i))
            ++
clientCount;
    }

    
GetMapTimeLeft(iTimeleft);
    
FormatTime(szTimesizeof(szTime), "%H:%M:%S"GetTime());
    
FormatTime(sTimesizeof(sTime), "%M:%S"iTimeleft);

    for(
int i 1<= MaxClientsi++)
    {
        if(
g_bIsHudEnabled[i] && IsClientValid(i))
        {
            if(
g_cvarHudStyle.IntValue == 1)
            {
                if(
g_bMapHasTimeLimit)
                {
                    if(!(
iTimeleft 0))
                        
Format(MapTimeLeft,sizeof(MapTimeLeft), "Ultima Runda");
                    else
                        
Format(MapTimeLeft,sizeof(MapTimeLeft), "%s"sTime);

                    
Format(iBuffersizeof(iBuffer),"%s\\Jucatori: %d/%d\nTimeleft: %s\nOra: %s",g_iMessage1clientCountGetMaxHumanPlayers(), MapTimeLeftszTime);
                    
SetHudTextParams(0.00.05.2g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 25500.00.00.0);
                    
ShowSyncHudText(igh_SyncHUDiBuffer);
                }
                else
                {
                    
Format(iBuffersizeof(iBuffer),"%s\\Jucatori: %d/%d\\Ora: %s",g_iMessage1clientCountGetMaxHumanPlayers(), szTime);
                    
SetHudTextParams(0.00.05.2g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 25500.00.00.0);
                    
ShowSyncHudText(igh_SyncHUDiBuffer);
                }
            }
            else if(
g_cvarHudStyle.IntValue == 2)
            {
                if(
g_bMapHasTimeLimit)
                {
                    if(!(
iTimeleft 0))
                        
Format(MapTimeLeft,sizeof(MapTimeLeft), "Ultima Runda");
                    else
                        
Format(MapTimeLeft,sizeof(MapTimeLeft), "%s"sTime);

                    
Format(iBuffersizeof(iBuffer),"Jucatori: %d/%d\nTimp Ramas: %s\nOra: %s\n%s"clientCountGetMaxHumanPlayers(), MapTimeLeftszTimeg_iMessage1);
                    
SetHudTextParams(-1.01.05.2g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 25500.00.00.0);
                    
ShowSyncHudText(igh_SyncHUDiBuffer);
                }
                else
                {
                    
Format(iBuffersizeof(iBuffer),"Jucatori: %d/%d\nOra: %s\n%s"clientCountGetMaxHumanPlayers(), szTimeg_iMessage1);
                    
SetHudTextParams(-1.01.05.2g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 25500.00.00.0);
                    
ShowSyncHudText(igh_SyncHUDiBuffer);
                }
            }
        }
        if(!
g_bIsHudEnabled[i] && IsClientValid(i))
        {
            
Format(iBuffersizeof(iBuffer),"%s"g_iMessage1);
            
SetHudTextParams(-1.00.0755.2g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 25500.00.00.0);
            
ShowSyncHudText(igh_SyncHUDiBuffer);
        }
    }
}


public 
Action Timer_Ads(Handle timer)
{
    
Format(g_cCurrentMessagesizeof(g_cCurrentMessage), g_cParts[g_iNextMessage]);

    
int effect GetConVarInt(g_cvarEffectType);
    
float effectDuration GetConVarFloat(g_cvarEffectDuration);
    
float fadeIn GetConVarFloat(g_cvarFadeInDuration);
    
float fadeOut GetConVarFloat(g_cvarFadeOutDuration);
    
int iRED GetRandomInt(0,255);
    
int iGREEN GetRandomInt(0,255);
    
int iBLUE GetRandomInt(0,255);

    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientValid(i))
        {
            if(
g_cvarHudStyle.IntValue == 1)
            {
                if(
g_bIsHudEnabled[i])
                {
                    
SetHudTextParams(-1.00.075g_fTimeHeldiREDiGREENiBLUE255effecteffectDurationfadeInfadeOut);
                    
ShowSyncHudText(igh_SyncHUD_Adsg_cCurrentMessage);
                }
                else if(!
g_bIsHudEnabled[i])
                {
                    
SetHudTextParams(-1.01.0g_fTimeHeldiREDiGREENiBLUE255effecteffectDurationfadeInfadeOut);
                    
ShowSyncHudText(igh_SyncHUD_Adsg_cCurrentMessage);
                }
            }
            else if(
g_cvarHudStyle.IntValue == 2)
            {
                if(
g_bIsHudEnabled[i])
                {
                    
SetHudTextParams(-1.00.075g_fTimeHeldiREDiGREENiBLUE255effecteffectDurationfadeInfadeOut);
                    
ShowSyncHudText(igh_SyncHUD_Adsg_cCurrentMessage);
                }
                else if(!
g_bIsHudEnabled[i])
                {
                    
SetHudTextParams(-1.01.0g_fTimeHeldiREDiGREENiBLUE255effecteffectDurationfadeInfadeOut);
                    
ShowSyncHudText(igh_SyncHUD_Adsg_cCurrentMessage);
                }
            }
        }
    }
    if (
g_iNextMessage != g_iAdsAmt 1) {
        
g_iNextMessage++;
    }
    else
    {
        
g_iNextMessage 0;
    }
}

bool IsClientValid(int client)
{
    return (
client <= MaxClients) && IsClientInGame(client) && !IsFakeClient(client);
}

void UpdateHUDColor() {
    
char buffer[16];
    
g_cvarHUDColors.GetString(buffersizeof(buffer));

    
char buffer2[3][4];
    
ExplodeString(buffer","buffer2sizeof(buffer2), sizeof(buffer2[]));

    for (
int i 03i++) {
        
g_iHUDColors[i] = StringToInt(buffer2[i]);
    }

FroGeX is offline
DGVaniX
Junior Member
Join Date: Jan 2021
Old 01-28-2021 , 18:47   Re: [CSGO] entity_prop_stocks errors when compiling
Reply With Quote #5

Quote:
Originally Posted by FroGeX View Post
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <clientprefs>

public Plugin myinfo =
{
    
name "CSGO HUD",
    
author "xSLOW",
    
description "CSGO HUD",
    
version "3.0"
};

enum {
    
RED 0,
    
GREEN,
    
BLUE
}

ConVar g_cvarMessage1g_cvarHUDColorsg_cvarAds, \
        
g_cvarTimeHeldg_cvarTimeBetweenAdsg_cvarEffectTypeg_cvarEffectDurationg_cvarFadeInDuration, \
         
g_cvarFadeOutDurationg_cvarHudStyle;

Handle g_hHUDv2Cookiegh_SyncHUD nullgh_SyncHUD_Ads null;
bool g_bIsHudEnabled[MAXPLAYERS 1], g_bMapHasTimeLimit false;
int g_iHUDColors[3], g_iMapTimeLimitg_iAdsAmtg_iNextMessage;
char g_sAds[1024], g_cCurrentMessage[128], g_cParts[16][128], g_iMessage1[128];
float g_fTimeHeld;

public 
void OnPluginStart()
{
    
g_hHUDv2Cookie RegClientCookie("csgo_hud""csgo_hud"CookieAccess_Protected);

    
g_cvarMessage1 CreateConVar("sm_hud_message1""MESSAGE 1""Top-Left first message"FCVAR_NOTIFY);
    
g_cvarHUDColors CreateConVar("sm_hud_rgb""0,102,204""RGB of the text. You can get more colors from https://www.hexcolortool.com/"FCVAR_NOTIFY);
    
g_cvarHudStyle CreateConVar("sm_hud_style""1""1 = Top Left on screen (where the radar is) and 2 = Bottom Mid on screen");

    
g_cvarAds CreateConVar("sm_hud_Ads""First;Second;Third;Fourth""Defines all Ads, separated by semicolons.");
    
g_cvarTimeHeld CreateConVar("sm_hud_timeheld""2.0""Amount of time in seconds Ads are held.");
    
g_cvarTimeBetweenAds CreateConVar("sm_hud_timebetweenAds""2.0""Amount of time in seconds between Ads.");
    
g_cvarEffectType CreateConVar("sm_hud_effect_type""1.0""0 - Fade In; 1 - Fade out; 2 - Flash"_true0.0true2.0);
    
g_cvarEffectDuration CreateConVar("sm_hud_effect_duration""0.5""Duration of the selected effect. Not always aplicable");
    
g_cvarFadeInDuration CreateConVar("sm_hud_fadein_duration""0.5""Duration of the selected effect.");
    
g_cvarFadeOutDuration CreateConVar("sm_hud_fadeout_duration""0.5""Duration of the selected effect.");
    
Format(g_sAdssizeof(g_sAds), "");

    
AutoExecConfig(true"csgo_hud");

    
UpdateHUDColor();
    
g_cvarHUDColors.AddChangeHook(cvarChanged_HUDColor);

    
CreateTimer(3.0Timer_Hud_TIMER_REPEAT);

    
RegConsoleCmd("hud"Command_hud);

        for(
int i 1<= MaxClientsi++)
            
EnableHoodini(i);

    
gh_SyncHUD CreateHudSynchronizer();
    
gh_SyncHUD_Ads CreateHudSynchronizer();
}

public 
void OnMapStart()
{
    
g_bMapHasTimeLimit false;
    
GetMapTimeLimit(g_iMapTimeLimit);
    if(
g_iMapTimeLimit 0)
        
g_bMapHasTimeLimit true;

    
g_cvarMessage1.GetString(g_iMessage1sizeof(g_iMessage1));
}

public 
void OnPluginEnd()
{
    
CloseHandle(gh_SyncHUD);
    
CloseHandle(gh_SyncHUD_Ads);
}

public 
void OnConfigsExecuted()
{
    
GetConVarString(g_cvarAdsg_sAdssizeof(g_sAds));
    
Format(g_sAdssizeof(g_sAds), "%s"g_sAds);
    
g_iAdsAmt ExplodeString(g_sAds";"g_cPartssizeof(g_cParts), sizeof(g_cParts[]));
    
float timeBetweenAds GetConVarFloat(g_cvarTimeBetweenAds);
    
g_fTimeHeld GetConVarFloat(g_cvarTimeHeld);
    
g_iNextMessage 0;
    
CreateTimer(g_fTimeHeld timeBetweenAdsTimer_Ads_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

void EnableHoodini(int client)
{
    if(
AreClientCookiesCached(client) && IsClientValid(client))
    {
        
g_bIsHudEnabled[client] = false;
        
char buffer[64];
        
GetClientCookie(clientg_hHUDv2Cookiebuffersizeof(buffer));
        if(
StrEqual(buffer,"1"))
            
g_bIsHudEnabled[client] = true;
    }
}

public 
void OnClientPostAdminCheck(int client)
{
    
EnableHoodini(client);
}

public 
void OnClientCookiesCached(int client)
{
    
EnableHoodini(client);
}

public 
void cvarChanged_HUDColor(ConVar convar, const char[] oldValue, const char[] newValue) {
    
UpdateHUDColor();
}

public 
Action Command_hud(int clientint args)
{
    if(
g_bIsHudEnabled[client])
    {
        
PrintToChat(client" ★ \x02HUD is now off");
        
g_bIsHudEnabled[client] = false;
        
SetClientCookie(clientg_hHUDv2Cookie"0");
    }
    else
    {
        
PrintToChat(client" ★ \x04HUD is now on");
        
g_bIsHudEnabled[client] = true;
        
SetClientCookie(clientg_hHUDv2Cookie"1");
    }
}


public 
Action Timer_Hud(Handle timerany client)
{
    
int clientCount 0iTimeleft;
    
char sTime[64], szTime[30], MapTimeLeft[128], iBuffer[1024];

    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && !IsFakeClient(i))
            ++
clientCount;
    }

    
GetMapTimeLeft(iTimeleft);
    
FormatTime(szTimesizeof(szTime), "%H:%M:%S"GetTime());
    
FormatTime(sTimesizeof(sTime), "%M:%S"iTimeleft);

    for(
int i 1<= MaxClientsi++)
    {
        if(
g_bIsHudEnabled[i] && IsClientValid(i))
        {
            if(
g_cvarHudStyle.IntValue == 1)
            {
                if(
g_bMapHasTimeLimit)
                {
                    if(!(
iTimeleft 0))
                        
Format(MapTimeLeft,sizeof(MapTimeLeft), "Ultima Runda");
                    else
                        
Format(MapTimeLeft,sizeof(MapTimeLeft), "%s"sTime);

                    
Format(iBuffersizeof(iBuffer),"%s\\Jucatori: %d/%d\nTimeleft: %s\nOra: %s",g_iMessage1clientCountGetMaxHumanPlayers(), MapTimeLeftszTime);
                    
SetHudTextParams(0.00.05.2g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 25500.00.00.0);
                    
ShowSyncHudText(igh_SyncHUDiBuffer);
                }
                else
                {
                    
Format(iBuffersizeof(iBuffer),"%s\\Jucatori: %d/%d\\Ora: %s",g_iMessage1clientCountGetMaxHumanPlayers(), szTime);
                    
SetHudTextParams(0.00.05.2g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 25500.00.00.0);
                    
ShowSyncHudText(igh_SyncHUDiBuffer);
                }
            }
            else if(
g_cvarHudStyle.IntValue == 2)
            {
                if(
g_bMapHasTimeLimit)
                {
                    if(!(
iTimeleft 0))
                        
Format(MapTimeLeft,sizeof(MapTimeLeft), "Ultima Runda");
                    else
                        
Format(MapTimeLeft,sizeof(MapTimeLeft), "%s"sTime);

                    
Format(iBuffersizeof(iBuffer),"Jucatori: %d/%d\nTimp Ramas: %s\nOra: %s\n%s"clientCountGetMaxHumanPlayers(), MapTimeLeftszTimeg_iMessage1);
                    
SetHudTextParams(-1.01.05.2g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 25500.00.00.0);
                    
ShowSyncHudText(igh_SyncHUDiBuffer);
                }
                else
                {
                    
Format(iBuffersizeof(iBuffer),"Jucatori: %d/%d\nOra: %s\n%s"clientCountGetMaxHumanPlayers(), szTimeg_iMessage1);
                    
SetHudTextParams(-1.01.05.2g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 25500.00.00.0);
                    
ShowSyncHudText(igh_SyncHUDiBuffer);
                }
            }
        }
        if(!
g_bIsHudEnabled[i] && IsClientValid(i))
        {
            
Format(iBuffersizeof(iBuffer),"%s"g_iMessage1);
            
SetHudTextParams(-1.00.0755.2g_iHUDColors[RED], g_iHUDColors[GREEN], g_iHUDColors[BLUE], 25500.00.00.0);
            
ShowSyncHudText(igh_SyncHUDiBuffer);
        }
    }
}


public 
Action Timer_Ads(Handle timer)
{
    
Format(g_cCurrentMessagesizeof(g_cCurrentMessage), g_cParts[g_iNextMessage]);

    
int effect GetConVarInt(g_cvarEffectType);
    
float effectDuration GetConVarFloat(g_cvarEffectDuration);
    
float fadeIn GetConVarFloat(g_cvarFadeInDuration);
    
float fadeOut GetConVarFloat(g_cvarFadeOutDuration);
    
int iRED GetRandomInt(0,255);
    
int iGREEN GetRandomInt(0,255);
    
int iBLUE GetRandomInt(0,255);

    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientValid(i))
        {
            if(
g_cvarHudStyle.IntValue == 1)
            {
                if(
g_bIsHudEnabled[i])
                {
                    
SetHudTextParams(-1.00.075g_fTimeHeldiREDiGREENiBLUE255effecteffectDurationfadeInfadeOut);
                    
ShowSyncHudText(igh_SyncHUD_Adsg_cCurrentMessage);
                }
                else if(!
g_bIsHudEnabled[i])
                {
                    
SetHudTextParams(-1.01.0g_fTimeHeldiREDiGREENiBLUE255effecteffectDurationfadeInfadeOut);
                    
ShowSyncHudText(igh_SyncHUD_Adsg_cCurrentMessage);
                }
            }
            else if(
g_cvarHudStyle.IntValue == 2)
            {
                if(
g_bIsHudEnabled[i])
                {
                    
SetHudTextParams(-1.00.075g_fTimeHeldiREDiGREENiBLUE255effecteffectDurationfadeInfadeOut);
                    
ShowSyncHudText(igh_SyncHUD_Adsg_cCurrentMessage);
                }
                else if(!
g_bIsHudEnabled[i])
                {
                    
SetHudTextParams(-1.01.0g_fTimeHeldiREDiGREENiBLUE255effecteffectDurationfadeInfadeOut);
                    
ShowSyncHudText(igh_SyncHUD_Adsg_cCurrentMessage);
                }
            }
        }
    }
    if (
g_iNextMessage != g_iAdsAmt 1) {
        
g_iNextMessage++;
    }
    else
    {
        
g_iNextMessage 0;
    }
}

bool IsClientValid(int client)
{
    return (
client <= MaxClients) && IsClientInGame(client) && !IsFakeClient(client);
}

void UpdateHUDColor() {
    
char buffer[16];
    
g_cvarHUDColors.GetString(buffersizeof(buffer));

    
char buffer2[3][4];
    
ExplodeString(buffer","buffer2sizeof(buffer2), sizeof(buffer2[]));

    for (
int i 03i++) {
        
g_iHUDColors[i] = StringToInt(buffer2[i]);
    }

Nope, doesn't compile, same errors
DGVaniX is offline
FroGeX
Senior Member
Join Date: Aug 2020
Old 01-28-2021 , 19:08   Re: [CSGO] entity_prop_stocks errors when compiling
Reply With Quote #6

for me is normal compileable
FroGeX is offline
DGVaniX
Junior Member
Join Date: Jan 2021
Old 01-30-2021 , 13:45   Re: [CSGO] entity_prop_stocks errors when compiling
Reply With Quote #7

Quote:
Originally Posted by FroGeX View Post
for me is normal compileable
Strange. Could you please send me your entire 'scripting' folder? Without any other scripts of course, but with your 'include' folder, maybe that's the issue for me.
DGVaniX is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-30-2021 , 18:13   Re: [CSGO] entity_prop_stocks errors when compiling
Reply With Quote #8

Try this:

Spoiler
Attached Files
File Type: sp Get Plugin or Get Source (test.sp - 77 views - 9.9 KB)
__________________

Last edited by Marttt; 01-30-2021 at 18:16.
Marttt is offline
Reply



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 02:20.


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