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

Hud text dont work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 01-13-2018 , 11:03   Hud text dont work
Reply With Quote #1

Hello coders,

i have one big problem with hudtext in csgo, i made menu, and after somebody click on this menu, it will print something into hud, but it dont work and idk why no, here is code.

PHP Code:
#pragma semicolon 1

#define LoopClients(%1) for(int %1 = 1; %1 <= MaxClients; %1++) 

#define DEBUG

#define PLUGIN_AUTHOR "Javierko"
#define PLUGIN_VERSION "1.0.1"

#include <sourcemod>
#include <sdktools>

#pragma newdecls required

Handle HudText;

public 
Plugin myinfo 
{
    
name "Admin",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url ""
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_admind"Command_Adminp);
    
    
HudText CreateHudSynchronizer();
}

public 
Action Command_Adminp(int clientint args)
{
    
Menu menu = new Menu(m_themenu);
    
menu.SetTitle("Admin menu");
    if (
IsPlayerAdmin(client))
    {
        
menu.AddItem("item_1""Test message");
        
menu.Display(clientMENU_TIME_FOREVER);
    }
}

public 
int m_themenu(Menu menuMenuAction actionint clientint index)
{
    if(
action == MenuAction_Select)
    {
        
char szItem[12];
        
menu.GetItem(indexszItemsizeof(szItem));
        if(
StrEqual(szItem"item_1"false))
        {
            
LoopClients(i)
            {
                
SetHudTextParams(-1.0, -1.010.025525525525520.00.250.25);
                
ShowSyncHudText(iHudText"This is testing message!");
            }
           }
    }
      else if(
action == MenuAction_End)
      {    
        
delete menu;
      }
}

stock bool IsPlayerAdmin(int client)
{
  if(
CheckCommandAccess(client""ADMFLAG_GENERIC))
  {
    return 
true;
  }
  return 
false;

Thanks if you help me.
__________________
My Github & Sourcemod work.
If you like my work and if you want to support me, you can through PayPal.

Official SourceMod CZ/SK Discord: https://discord.gg/Qvar55a
Javierko is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 01-13-2018 , 11:36   Re: Hud text dont work
Reply With Quote #2

check your error log
i'm sure there is something there
__________________
8guawong is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 01-13-2018 , 12:15   Re: Hud text dont work
Reply With Quote #3

I didnt find anything about my plugin on this what i posted.
__________________
My Github & Sourcemod work.
If you like my work and if you want to support me, you can through PayPal.

Official SourceMod CZ/SK Discord: https://discord.gg/Qvar55a
Javierko 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 13:52.


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