RSSy MYGO.pl Opublikowano Wrzesień 8, 2022 o 02:57 RSSy Udostępnij Opublikowano Wrzesień 8, 2022 o 02:57 This plugin used to work but it doesn't anymore. It basically shows in the hud the name, map and amount of players of a certain server's IP. Back in the day it used to show something like this in the hud: CS 1.6 Server [de_dust2] (32/32) Now it shows something like this: [] (0/0) Thanks! 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.33.40: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_NAME, AMXX_VERSION_STR, PLUGIN_AUTHOR); register_event("HLTV", "event_HLTV", "a", "1=0", "2=0"); } public event_HLTV() { new i; for (i = 0; i < sizeof(SERVERS_IP); i++) { ServerInfo(SERVERS_IP[i], "getServerInfo"); } set_task(1.0, "task_ShowServers"); } public task_ShowServers(id) { new i, sBuffer[256]; for (i = 0; i < sizeof(SERVERS_IP); i++) { formatex(sBuffer, charsmax(sBuffer), "%s [%s] (%d/%d)", g_server_name[i], g_server_map[i], g_server_online_players[i], g_server_maxplayers[i]); set_hudmessage(000, 100, 255, -1.0, 0.01, 0, 0.0, 10.0, 0.5, 0.10, 1); show_hudmessage(id, sBuffer); } } /* Código de Neee...eeel.- (Community Info) */ public getServerInfo(const szServer[], _A2A_TYPE, const Response[], len, success, latency) { if (!success) { return; } new serverId = -1; for (new i = 0; i < sizeof(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(Response, szName, charsmax(szName), szMap, charsmax(szMap), szDirectory, charsmax(szDirectory), szDescription, charsmax(szDescription), iPlayers, iMaxPlayers); 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; } Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi