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

Solved need help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Johnoclock
Member
Join Date: Oct 2014
Location: denmark
Old 06-07-2020 , 20:05   need help
Reply With Quote #1

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_CrosshairADMFLAG_KICK"This is my great command");
    
    
CreateTimer(0.1Timer_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 clientint 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!"PREFIXg_bEnabled[client] ? "\x04Du mærker en kilden nede i bukserne":"\x02NU SPRØJTER DET!");
    }
    return 
Plugin_Handled;
}

public 
Action Timer_Hud(Handle timerany data)
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && !IsFakeClient(i))
        {
            if (
IsPlayerAlive(i) && g_bEnabled[i])
            {
                
int currentWeapon GetEntPropEnt(iProp_Send"m_hActiveWeapon");
                if (
currentWeapon == -1)
                {
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
                
int itemIndex GetEntProp(currentWeaponProp_Send"m_iItemDefinitionIndex");
                if (
itemIndex != 9// weapon awp
                
{
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
int itemIndex40 GetEntProp(currentWeaponProp_Send"m_iItemDefinitionIndex");
                if (
itemIndex40 != 40// weapon ssg 08
                
{
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
int itemIndex11 GetEntProp(currentWeaponProp_Send"m_iItemDefinitionIndex");
                if (
itemIndex11 != 11// weapon g3sgg1
                
{
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
int itemIndex38 GetEntProp(currentWeaponProp_Send"m_iItemDefinitionIndex");
                if (
itemIndex38 != 38// weapon scar20
                
{
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
int fov GetEntProp(iProp_Data"m_iFOV");
                if (
fov && fov GetEntProp(iProp_Data"m_iDefaultFOV"))
                {
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
                
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                
ShowHudText(i2"+");
            }
        }
    }


Last edited by Johnoclock; 06-07-2020 at 20:18.
Johnoclock is offline
Vieni
Member
Join Date: Apr 2018
Old 06-07-2020 , 20:13   Re: need help
Reply With Quote #2

Quote:
Originally Posted by john96dk View Post
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_CrosshairADMFLAG_KICK"This is my great command");
    
    
CreateTimer(0.1Timer_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 clientint 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!"PREFIXg_bEnabled[client] ? "\x04Du mærker en kilden nede i bukserne":"\x02NU SPRØJTER DET!");
    }
    return 
Plugin_Handled;
}

public 
Action Timer_Hud(Handle timerany data)
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && !IsFakeClient(i))
        {
            if (
IsPlayerAlive(i) && g_bEnabled[i])
            {
                
int currentWeapon GetEntPropEnt(iProp_Send"m_hActiveWeapon");
                if (
currentWeapon == -1)
                {
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
                
int itemIndex GetEntProp(currentWeaponProp_Send"m_iItemDefinitionIndex");
                if (
itemIndex != 9// weapon awp
                
{
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
int itemIndex40 GetEntProp(currentWeaponProp_Send"m_iItemDefinitionIndex");
                if (
itemIndex40 != 40// weapon ssg 08
                
{
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
int itemIndex11 GetEntProp(currentWeaponProp_Send"m_iItemDefinitionIndex");
                if (
itemIndex11 != 11// weapon g3sgg1
                
{
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
int itemIndex38 GetEntProp(currentWeaponProp_Send"m_iItemDefinitionIndex");
                if (
itemIndex38 != 38// weapon scar20
                
{
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
int fov GetEntProp(iProp_Data"m_iFOV");
                if (
fov && fov GetEntProp(iProp_Data"m_iDefaultFOV"))
                {
                    
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                }
                
                
SetHudTextParams(-1.0, -1.00.152552525000.00.00.0);
                
ShowHudText(i2"+");
            }
        }
    }

Wrong thread, I think you should post here: https://forums.alliedmods.net/forumdisplay.php?f=107

Btw, maybe 'cause of this?
HTML Code:
CreateTimer(0.1, Timer_Hud, _, TIMER_REPEAT)
-->
HTML Code:
CreateTimer(0.1, "Timer_Hud", _, TIMER_REPEAT)
I'm not familiar with source code, but feel free to try it if no answer comes
Vieni is offline
Johnoclock
Member
Join Date: Oct 2014
Location: denmark
Old 06-07-2020 , 20:17   Re: need help
Reply With Quote #3

Quote:
Originally Posted by Vieni View Post
Wrong thread, I think you should post here: https://forums.alliedmods.net/forumdisplay.php?f=107

Btw, maybe 'cause of this?
HTML Code:
CreateTimer(0.1, Timer_Hud, _, TIMER_REPEAT)
-->
HTML Code:
CreateTimer(0.1, "Timer_Hud", _, TIMER_REPEAT)
I'm not familiar with source code, but feel free to try it if no answer comes
i dont think is that but thanks it works with only one weapon
PHP Code:
                int itemIndex GetEntProp(currentWeaponProp_Send"m_iItemDefinitionIndex");
                if (
itemIndex != 9// weapon awp
                
{
                    
SetHudTextParams(-1.0, -1.00.15255252100.00.00.0);
                    
ShowHudText(i2"");
                    continue;
                } 
Johnoclock 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 04:18.


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