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

Help with this server hud plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 09-07-2022 , 22:57   Help with this server hud plugin
Reply With Quote #1

This plugin used to show the server info of a certain IP but now it doesn't anymore. Any idea as to why? It used to show something like "Server CS 1.6 [de_dust2] (32/32)". Now it shows [] (0/0).

PHP Code:
#include <amxmodx>
#include <server_query>

#pragma semicolon 1

#define PLUGIN_NAME "Servers Hud"
#define PLUGIN_AUTHOR "exo"

#define SZPREFIX "!g[SERVER]!y"

new const SERVERS_IP[][] =
{
    
"131.221.22.70:27015",
};

new 
g_server_name[32][256];
new 
g_server_map[32][32];
new 
g_server_maxplayers[32];
new 
g_server_online_players[32];

public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEAMXX_VERSION_STRPLUGIN_AUTHOR);

    
register_event("HLTV""event_HLTV""a""1=0""2=0");
}

public 
event_HLTV()
{
    new 
i;
    for (
0sizeof(SERVERS_IP); i++)
    {
        
ServerInfo(SERVERS_IP[i], "getServerInfo");
    }

    
set_task(1.0"task_ShowServers");
}

public 
task_ShowServers(id)
{
    new 
isBuffer[256];
    for (
0sizeof(SERVERS_IP); i++)
    {
        
formatex(sBuffercharsmax(sBuffer), "%s [%s] (%d/%d)"g_server_name[i], g_server_map[i], g_server_online_players[i], g_server_maxplayers[i]);
        
        
set_hudmessage(000100255, -1.00.0100.010.00.50.101);
        
show_hudmessage(idsBuffer);
    }
}

/* Código de Neee...eeel.- (Community Info) */
public getServerInfo(const szServer[], _A2A_TYPE, const Response[], lensuccesslatency)
{
    if (!
success)
    {
        return;
    }
    
    new 
serverId = -1;
    for (new 
0sizeof(SERVERS_IP); i++)
    {
        if (
equal(SERVERS_IP[i], szServer))
        {
            
serverId i;
            break;
        }
    }
    
    if (
serverId == -1)
    {
        return;
    }
    
    new 
szName[256], szMap[64], szDirectory[64], szDescription[64];
    new 
iPlayers 0;
    new 
iMaxPlayers 0;

    
ServerResponseParseInfo(ResponseszNamecharsmax(szName), szMapcharsmax(szMap), szDirectorycharsmax(szDirectory), szDescriptioncharsmax(szDescription), iPlayersiMaxPlayers);
    
    
copy(g_server_name[serverId], charsmax(g_server_name[]), szName);
    
copy(g_server_map[serverId], charsmax(g_server_map[]), szMap);
    
g_server_online_players[serverId] = iPlayers;
    
g_server_maxplayers[serverId] = iMaxPlayers;


Last edited by JuanitoAlimana; 09-25-2022 at 04:46.
JuanitoAlimana is offline
Old 09-07-2022, 23:09
JuanitoAlimana
This message has been deleted by JuanitoAlimana. Reason: Unncesary
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-10-2022 , 02:48   Re: Help with this server hud plugin
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <amxmisc>

const TASK_HUD 364888

new g_iMaxPlayersg_szServerName32 ], g_iObjectHud;

public 
plugin_init( )
{
    
register_plugin"HUD Server Informations""1.0""Supremache" );
    
get_user_name0g_szServerNamecharsmaxg_szServerName ) );
    
g_iMaxPlayers get_maxplayers( );
    
    
g_iObjectHud CreateHudSyncObj( );
}

public 
client_connectid )
{
    
set_task1.0"DisplayHUD"id TASK_HUD, .flags "b" )
}

public 
DisplayHUDid )
{
    static 
iPlayersszMap32 ];
    
iPlayers get_playersnum( );
    
get_mapnameszMapcharsmaxszMap ) );
    
get_playersnum( ), get_maxplayers( );
    
    
set_hudmessage01252000.020.9006.001.100.000.00, -);
    
ShowSyncHudMsgidg_iObjectHud"%s [%s] (%d/%d)"g_szServerNameszMapiPlayersg_iMaxPlayers )

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 09-10-2022 , 18:25   Re: Help with this server hud plugin
Reply With Quote #3

Oh, maybe I didn't make myself clear. This plugin shows you the information of ANOTHER server in the server that the plugin is being used. I have two servers, and I want the players of one of the server to see in the upper screen the stats of my other server. Thanks.
JuanitoAlimana is offline
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 09-25-2022 , 04:46   Re: Help with this server hud plugin
Reply With Quote #4

Any help?
JuanitoAlimana is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-25-2022 , 06:16   Re: Help with this server hud plugin
Reply With Quote #5

Means the query is being blocked.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 09-25-2022 , 23:47   Re: Help with this server hud plugin
Reply With Quote #6

I also thought that but I've tried with countless IP addresses and it's always the same :/
JuanitoAlimana is offline
Old 09-26-2022, 00:54
000
This message has been deleted by 000.
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 09-26-2022 , 01:23   Re: Help with this server hud plugin
Reply With Quote #7

Yep, but I suck at coding so I can't "immitate" or take from them what is useful lol
JuanitoAlimana is offline
Old 09-26-2022, 16:54
000
This message has been deleted by 000.
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 07:52.


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