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

need help (itemIndex)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Johnoclock
Member
Join Date: Oct 2014
Location: denmark
Old 06-07-2020 , 20:18   need help (itemIndex)
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"+");
            }
        }
    }

Johnoclock is offline
Reply


Thread Tools
Display Modes

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 12:57.


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