When I load my plugin it gets those errors in the bottom I do not really know how to fix it so I need help once again... and yes I know the
Code:
#include <sourcemod>
#include <clients>
#include <morecolors>
//Cvars|Handles
new Players = 0
new Handle:h_HUDTIMER = INVALID_HANDLE;
new Handle:HUDTIMER = INVALID_HANDLE;
new Handle:h_HUDFADEIN;
new Handle:h_HUDFADEOUT;
new Handle:h_HUDHOLDTIME;
new Handle:cvarRed;
new Handle:cvarGreen;
new Handle:cvarBlue;
new Handle:cvarAlpha;
new Handle:cvarhudx;
new Handle:cvarhudy;
//VARIABLES
new g_Red;
new g_Green;
new g_Blue;
new g_Alpha;
new Float:Hudx;
new Float:Hudy;
new Float:Holdtime;
new Float:Fadein;
new Float:Fadeout;
public Plugin:myinfo =
{
name = "ServerPlayers",
author = "Benjamin",
description = "How many players there is in server",
version = "2.0",
url = "http://steamcommunity.com/id/BenjaminHT/"
}
public OnPluginStart()
{
cvarhudx = CreateConVar("sm_hudx", "0.043", "Hud message x position. -1 = center.", FCVAR_PLUGIN, true, -1.0, true, 1.0);
cvarhudy = CreateConVar("sm_hudy", "-1.0", "Hud message y position. -1 = center.", FCVAR_PLUGIN, true, -1.0, true, 1.0);
cvarAlpha = CreateConVar("sm_hudalpha", "100.0", "Alpha.", FCVAR_PLUGIN, true, 0.0, true, 255.0);
cvarBlue = CreateConVar("sm_hudblue", "20.0", "Color in RGB(Blue).", FCVAR_PLUGIN, true, 0.0, true, 255.0);
cvarGreen = CreateConVar("sm_hudgreen", "255.0", "Color in RGB(Green).", FCVAR_PLUGIN, true, 0.0, true, 255.0);
cvarRed = CreateConVar("sm_hudred", "90.0", "Color in RGB(Red).", FCVAR_PLUGIN, true, 0.0, true, 255.0);
h_HUDFADEOUT = CreateConVar("sm_hud_fadeout_time", "1.0", "How much time it should take to fade out.", FCVAR_PLUGIN, true, 0.1, true, 5.0);
h_HUDFADEIN = CreateConVar("sm_hud_fadein_time", "1.0", "How much time it should take to fade in.", FCVAR_PLUGIN, true, 0.1, true, 5.0);
h_HUDHOLDTIME = CreateConVar("sm_hud_hold_time", "4.0", "How Long it should hold the text.", FCVAR_PLUGIN, true, 1.0, true, 30.0);
h_HUDTIMER = CreateConVar("sm_hudtimer", "40.0", "Timer before it prints to the HUD.", FCVAR_PLUGIN, true, 6.0, true, 290.0);
RegConsoleCmd("sm_players", MaxPlayers);
AutoExecConfig(true, "server_players");
}
//public OnMapStart()
public OnMapEnd()
{
if(HUDTIMER != INVALID_HANDLE && CloseHandle(HUDTIMER))
{
HUDTIMER = INVALID_HANDLE;
}
}
public OnClientPutInServer(client)
{
HUDTIMER = CreateTimer(GetConVarFloat(h_HUDTIMER), TimerCallBack, client, TIMER_REPEAT);
//CreateTimer(h_HUDTIMER, TimerCallBack, client, TIMER_REPEAT);
}
//===============================================================================
//===============================================================================
public Action:TimerCallBack(Handle:timer, any:client)
{
Hudx = GetConVarFloat(cvarhudx);
Hudy = GetConVarFloat(cvarhudy);
Fadein = GetConVarFloat(h_HUDFADEIN);
Fadeout = GetConVarFloat(h_HUDFADEOUT);
Holdtime = GetConVarFloat(h_HUDHOLDTIME);
g_Red = GetConVarInt(cvarRed);
g_Green = GetConVarInt(cvarGreen);
g_Blue = GetConVarInt(cvarBlue);
g_Alpha = GetConVarInt(cvarAlpha);
new Max = GetMaxClients();
SetHudTextParams(Hudx, Hudy, Holdtime, g_Red, g_Green, g_Blue, g_Alpha, 0, 6.0, Fadein, Fadeout);
ShowHudText(client, -1, "There is [%d/%d] players connected", Players, Max);
}
public OnClientConnected(client)
{
Players += 1;
}
public OnClientDisconnect(client)
{
Players -= 1;
}
public Action:MaxPlayers(client, args)
{
new Max = GetMaxClients();
CReplyToCommand(client, "{default}There is [{green}%d/%d{default}] players connected", Players, Max);
}