hello why do this not work if u need any other info feel free to ask
PHP Code:
#include <sourcemod>
#define PREFIX "[SM]"
bool g_bEnabled[MAXPLAYERS + 1] = false;
public void OnPluginStart()
{
RegAdminCmd("sm_sandermingud", Command_Crosshair, ADMFLAG_KICK, "This is my great command");
CreateTimer(0.1, Timer_Hud, _, TIMER_REPEAT);
}
public void OnClientPostAdminCheck(int client)
{
g_bEnabled[client] = false;
}
public void OnClientDisconnect(int client)
{
g_bEnabled[client] = false;
}
public Action Command_Crosshair(int client, int args)
{
if (IsClientInGame(client) && !IsFakeClient(client))
{
g_bEnabled[client] = !g_bEnabled[client];
PrintToChat(client, "%s Du mærker en lille rejsning %s\x01 DET KILDER!", PREFIX, g_bEnabled[client] ? "\x04Du mærker en kilden nede i bukserne":"\x02NU SPRØJTER DET!");
}
return Plugin_Handled;
}
public Action Timer_Hud(Handle timer, any data)
{
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && !IsFakeClient(i))
{
if (IsPlayerAlive(i) && g_bEnabled[i])
{
int currentWeapon = GetEntPropEnt(i, Prop_Send, "m_hActiveWeapon");
if (currentWeapon == -1)
{
SetHudTextParams(-1.0, -1.0, 0.15, 255, 25, 2, 50, 0, 0.0, 0.0, 0.0);
ShowHudText(i, 2, "");
continue;
}
int itemIndex = GetEntProp(currentWeapon, Prop_Send, "m_iItemDefinitionIndex");
if (itemIndex != 9) // weapon awp
{
SetHudTextParams(-1.0, -1.0, 0.15, 255, 25, 2, 50, 0, 0.0, 0.0, 0.0);
ShowHudText(i, 2, "");
continue;
}
int itemIndex40 = GetEntProp(currentWeapon, Prop_Send, "m_iItemDefinitionIndex");
if (itemIndex40 != 40) // weapon ssg 08
{
SetHudTextParams(-1.0, -1.0, 0.15, 255, 25, 2, 50, 0, 0.0, 0.0, 0.0);
ShowHudText(i, 2, "");
continue;
}
int itemIndex11 = GetEntProp(currentWeapon, Prop_Send, "m_iItemDefinitionIndex");
if (itemIndex11 != 11) // weapon g3sgg1
{
SetHudTextParams(-1.0, -1.0, 0.15, 255, 25, 2, 50, 0, 0.0, 0.0, 0.0);
ShowHudText(i, 2, "");
continue;
}
int itemIndex38 = GetEntProp(currentWeapon, Prop_Send, "m_iItemDefinitionIndex");
if (itemIndex38 != 38) // weapon scar20
{
SetHudTextParams(-1.0, -1.0, 0.15, 255, 25, 2, 50, 0, 0.0, 0.0, 0.0);
ShowHudText(i, 2, "");
continue;
}
int fov = GetEntProp(i, Prop_Data, "m_iFOV");
if (fov > 0 && fov < GetEntProp(i, Prop_Data, "m_iDefaultFOV"))
{
SetHudTextParams(-1.0, -1.0, 0.15, 255, 25, 2, 50, 0, 0.0, 0.0, 0.0);
ShowHudText(i, 2, "");
continue;
}
SetHudTextParams(-1.0, -1.0, 0.15, 255, 25, 2, 50, 0, 0.0, 0.0, 0.0);
ShowHudText(i, 2, "+");
}
}
}
}