Menu de jugadores
#26
ahora si lo abre, pero en el menu aparece esto:
[] (0/0)
y en el online tira 0/0
obvio paso una ronda... pero igual

[Community Info] Cargando servidor 190.0.164.xxx:27028

eso aparece en consola del servidor
Responder
#27
Poné amxx modules en consola y fijate que el módulo "Socket" esté ahí...
[Imagen: paypalqr.png]
Responder
#28
ThreadedSockets 1.8.2-dev Shooting King running
Responder
#29
(08/06/2016, 11:12 PM)themurder escribió: ThreadedSockets 1.8.2-dev Shooting King running
Ese no, el sockets default de AMXX.
[Imagen: paypalqr.png]
Responder
#30
es el que encontre Confundido otro no pude encontrar, por que no viene cuando instalas el amx

osea... ami no me vino en el servidor, y no puedo sacar el de mi pc por que no tengo linux
Responder
#31
En el paquete de instalación de AMXX viene por default... quizás está desactivado en el modules.ini
[Imagen: paypalqr.png]
Responder
#32
ya descargue uno de amxmod, pero aun asi no funciona el community info
Responder
#33
Acá te dejo el .so

Edit: Pero te fijaste si el módulo "sockets" está activo? Si no está eso no va a funcionar nunca.


Archivos adjuntos
.so   sockets_amxx_i386.so (Tamaño: 10.11 KB / Descargas: 4)
[Imagen: paypalqr.png]
Responder
#34
;;;
; To enable a module, remove the semi-colon (Guiño in front of its name.
; If it's not here, simply add it its name, one per line.
; You don't need to write the _amxx part or the file extension.
;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SQL Modules usually need to be enabled manually ;;
;; You can have any number on at a time. Use ;;
;; amx_sql_type in sql.cfg to specify the default ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;mysql
;sqlite

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Put third party modules below here. ;;
;; You can just list their names, without the _amxx ;;
;; or file extension. ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; These modules will be auto-detected and loaded ;;
;; as needed. You do not need to enable them here ;;
;; unless you have problems. ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

fun
engine
fakemeta
geoip
sockets
regex
nvault
cstrike
csx
hamsandwich

asi esta mi modules.ini

sisi ya lo descargue de la pagina de amxmod oficial. pero igual nada Confundido
Responder
#35
No vas a poder usar dicho "/server" ya que la empresa donde estás hospedado tiene bloqueada la comunicación por sockets en sus servidores.

Si conseguís una base de datos MySQL se puede hacer por ahí, sino te recomendaría que te quedes con el típico "/server" normal o te pases a otra empresa que hostee GameServers. Saludos.

PD: Es deducción a base de la IP que pasaste. Ese rango de IP está a nombre de una empresa la cual no permite tales querys (no permite el uso de sockets directamente). Si la IP que pasaste no es la de tu servidor entonces podés ignorar mi comentario pero dudo que sea así.
No hago trabajos privados. Si necesitás ayuda, abrí un nuevo tema.
¿Buscás un ejemplo o algún modo de juego? Podés echarle un vistazo a mis aportes
.
Responder
#36
No es eso... de la forma que me paso exertency funciona... pero quiero hacerlo desde la forma con el archivo .ini el sockets anda... esta activo... y funciona de la forma que paso exertency, pero para que mis amigos/socios, si quieren quitar o agregar un servidor a la lista.. que lo hagan desde un .ini, asi no tienen que tocar el plugin ya que no saben...
Responder
#37
Bueno mañana me fijo... ya me cansé de probar. Debe haber algún error en la función que trae la data.
[Imagen: paypalqr.png]
Responder
#38
(08/06/2016, 11:45 PM)Neeeeeeeeeel.- escribió: Bueno mañana me fijo... ya me cansé de probar. Debe haber algún error en la función que trae la data.

entonces a ti tampoco te funciona ?
[Imagen: bvpq9q-6.png]

NO DOY AYUDA VIA MENSAJE PRIVADO

* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Responder
#39
Yo no lo probé... el "ya me cansé de probar" fue un "ya me cansé de mandarte a hacer pruebas"
[Imagen: paypalqr.png]
Responder
#40
:/ bueno esta bn xD
Responder
#41
Código PHP:
#include <amxmodx>
#include <server_query>

new const __Plugin[][] = { "Servers Info" "1.0" "kikizon" };
new const 
Commands[][] = { "say /servers""say_team /servers""say /server""say_team /server" };
new const 
__FILE[] = "servers.ini";

#define MAX_SERVERS 20

#define TASK_UPGRADE 117783

new ServerIP[MAX_SERVERS][22], ServerNameMAX_SERVERS ][ 64 ],ServerMapMAX_SERVERS ][ 64 ], SvInReview33 ];
new 
ServerMaxPlayersMAX_SERVERS ], ServerPlayersMAX_SERVERS ], svip36 ];

public 
plugin_precache() get_user_ip0svip35 );

public 
client_putinserverindex SvInReviewindex ] = -1;

public 
plugin_init() 
{
    
register_plugin__Plugin0x0000 ] , __Plugin0x0001 ] , __Plugin0x0002 ] );
    
    new 
i;
    for( 
sizeof Commands-; ++)
        
register_clcmdCommands[i], "showServersMenu" );
    
    
register_event("HLTV""Upgrade""a""1=0""2=0");
    
    
GetIps();
}

public 
GetIps()
{
    new 
filepath64 ], linedata[22];
    
get_configsdir(filepathcharsmax(filepath));    
    
formatex(filepathcharsmax(filepath), "%s/%s"filepath__FILE );
    
    
    if (
file_exists(filepath))
    {
        new 
file fopen(filepath,"rt"), lineline 0;
        
        while (
file && !feof(file))
        {
            
fgets(filelinedatacharsmax(linedata));
                    
            if(!
linedata[0] || linedata[0] == ';') continue;
            
            
replace_all(linedatacharsmax(linedata), "^n""");
            
copy(ServerIP[line], 22linedata );
            ++
line;
            
            if( 
line >= MAX_SERVERS ) break;
        }
        
        if (
filefclose(file);
        
        
Upgrade();
    }
}

public 
Upgrade()
{
    static 
i;
    for( 
MAX_SERVERS ; ++)
    {
        if( !
ServerIP[i][0] ) continue;
        
        
ServerInfo(ServerIP[i], "GetServerInfo");
    }
}

public 
GetServerInfo(const szServer[], _A2A_TYPE, const Response[], lensuccesslatency)
{
    if(!
success) return;
                        
    static 
szDirectory[64], szDescription[64], ;
    for( 
MAX_SERVERS ; ++)
    {
        if( 
equalszServer ServerIP[i] ) )
        {
            
ServerResponseParseInfo(ResponseServerName[i], 63ServerMap[i], 63szDirectory63szDescription63ServerPlayers[i], ServerMaxPlayers[i]);
            break;
        }
    }
}

public 
showServersMenuindex )
{
    if( !
ServerIP[0][0] )
    {
        
client_printindex print_chat"Al parecer no hay servers cargados");
        return 
PLUGIN_HANDLED;
    }
    
    static 
iString512 ], menuActual25 ];                
    
    
menu menu_create"\r[ Comunidad CSOMX ] \yLista de servidores" "menu_servers" );
    
    for( 
MAX_SERVERS ; ++)
    {
        if( !
ServerIP[i][0] ) continue;
        
        if( 
equalsvipServerIP[i])) formatexActual24"\r( ACTUAL )" );
        else 
formatexActual24"" );
        
        
formatexString511"%s \r[ \w%d\y/\w%d \r]  %s"ServerName[i], ServerPlayers[i], ServerMaxPlayers[i], Actual );
        
        
menu_additemmenu String"" );
    }
    
    
menu_displayindex menu );
    return 
PLUGIN_HANDLED;
}

public 
menu_serversindex menu item )
{
    if( 
item != MENU_EXIT )
    {
        
SvInReviewindex ] = item;
        
ShowInfoindex );
    }
        
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;
}

public 
ShowInfoindex )
{
    static 
String128 ], menuitemitem SvInReviewindex ];
    
    
menu menu_create"\r[ Comunidad CSOMX ] \yInformacion de servidor""menu_info" );
    
    
formatexString127"\dNombre: \y%s"ServerName[item] );
    
menu_additemmenu String"" );
    
    
formatexString127"\dIP: \y%s"ServerIP[item] );
    
menu_additemmenu String"" );
    
    
formatexString127"\dMapa: \y%s"ServerMapitem ] );
    
menu_additemmenu String"" );
    
    
formatexString127"\dJugadores: \y%d \r| \y%d^n^n"ServerPlayersitem ], ServerMaxPlayersitem ] );
    
menu_additemmenu String"" );
    
    
    
menu_displayindex menu );
}

public 
menu_infoindex menu item )
{
    if( 
item != MENU_EXIT )
    {
        
ShowInfoindex );
        return 
PLUGIN_HANDLED;
    }    
    
    
SvInReviewindex ] = -1;
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;


Lo había hecho hace tiempo, solo le agregue lo del .ini (Pregunten a TOTO si no me creen :V )
[Imagen: bvpq9q-6.png]

NO DOY AYUDA VIA MENSAJE PRIVADO

* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Responder
#42
El de kikizon funciona perfecto, hace un tiempo lo probamos Sonrisa y funciona bien Lengua
[Imagen: b_350_20_323957_202743_f19a15_111111.png]

Estudia siempre; el tiempo es oro, lo material se puede recuperar pero el tiempo no se puede recuperar.
(02/10/2016, 05:05 PM)meTaLiCroSS escribió: Siempre me gusta ayudar cuando alguien esta interesado realmente en ver que esta programando.
(08/08/2019, 05:32 PM)meTaLiCroSS escribió: grax x el dato cr4ck


Mis aportes

PLUGINS
MAPAS
Menú LANG [SF] Sistema de Frags
Say System (Admin Prefix)
Responder
#43
muchas gracias, ya vere como puedo adaptar el de kiki todo en un solo menu xD

y que tengo que agregar en el .ini?
lo mismo que con el de neel?
Responder
#44
solo ips: ej

123.456.789.123:27015
123.456.789.125:27017

Si quieres puedes hacer comentarios en la ip tipo:

; Esta ip es para gays
123.456.789.123:27015

; Este no
123.456.789.125:27017

Osea bloquea los ";" pacman

Aunque estaria bueno meterle regex como el code de nel, para revisar si es ip valida, pero tal cual, funciona.
[Imagen: bvpq9q-6.png]

NO DOY AYUDA VIA MENSAJE PRIVADO

* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Responder
#45
eso del regex me tira error en el de nel, nose si sea por que no tengo regex o que, pero si lo tienes me lo pasas porfavor? al regex, sea modulo o inc no se xD
Responder
#46
no es 100% necesario, si metes las ips correctas en el .ini no pasa nada pacman
[Imagen: bvpq9q-6.png]

NO DOY AYUDA VIA MENSAJE PRIVADO

* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Responder
#47
Error: Invalid character constant on line 35
Error: Invalid character constant on line 35
Warning: Function "cmdReload" should return a value on line 106
Warning: Function "cmdConfigReload" should return a value on line 113

2 Errors.


este seria el codigo:
Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <server_query>
#include <regex>

const MAX_SERVERS 32;

new 
g_serverCount;

new 
g_szServer[MAX_SERVERS][32];
new 
g_szName[MAX_SERVERS][256];
new 
g_szMap[MAX_SERVERS][32];
new 
g_iPlayer[MAX_SERVERS];
new 
g_iMaxplayers[MAX_SERVERS];

public 
plugin_init(){
    
register_plugin("Community Info""v2.0.2""Neeeeeeeeeel.-");
    
    
register_event("HLTV""event_round_start""a""1=0""2=0");
    
    
register_clcmd("say /online""cmdOnline");
    
register_clcmd("say /servers""cmdServers");
    
register_clcmd("amx_ci_reload""cmdReload"ADMIN_KICK" - Recarga la información de los servidores");
    
register_clcmd("amx_ci_config_reload""cmdConfigReload"ADMIN_KICK" - Recarga la lista de servidores del archivo de configuracion");
    
    
loadServers();
}

public 
loadServers(){
    new 
configdir[128];
    
get_configsdir(configdircharsmax(configdir));
    
formatex(configdircharsmax(configdir), "%s/servidores.ini"configdir);
    
    new 
reterror[128];
    new 
Regex:regex regex_compile("^(?=\d+\.\d+\.\d+\.\d+\:[0-9]{1,5}$)(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\.?){4}\:[0-9]{1,5}$"reterrorcharsmax(error));
    
    if (
file_exists(configdir)){
        new 
szServer[33];
        
        new 
file fopen(configdir"rt");
        if (!
file){
            return;
        }
        
        while (!
feof(file)){
            
fgets(fileszServercharsmax(szServer))
            if (
szServer[0] == ';' || !szServer[0]){
                continue;
            }
            
remove_quotes(szServer);
            
replace_all(szServercharsmax(szServer), "^n""");
            
            if (
regex_match_c(szServerregexret) > 0){
                
console_print(0"[Community Info] Cargando servidor %s"szServer);
                
copy(g_szServer[g_serverCount], charsmax(g_szServer[]), szServer);
                
g_serverCount++;
            }
        }
        
fclose(file);
    } else {
        
console_print(0"[Community Info] Archivo de configuracion inexistente");
    }
    
    
regex_free(regex);
}

public 
event_round_start(){
    for (new 
0g_serverCounti++){
        
ServerInfo(g_szServer[i], "getServerInfo");
    }
}

public 
cmdOnline(id){
    new 
players;
    new 
maxplayers;
    for (new 
0g_serverCounti++){
        
players += g_iPlayer[i];
        
maxplayers += g_iMaxplayers[i];
    }
    
client_print(idprint_chat"[AMXX] Hay %d/%d conectados en la comunidad"playersmaxplayers);
    return 
PLUGIN_CONTINUE;
}

public 
cmdServers(id){
    new 
menu menu_create("\yLista de servidores""cmdServers_callback");
    new 
szOption[512];
    
    for (new 
0g_serverCounti++){
        static 
szId[3];
        
num_to_str(iszIdcharsmax(szId));
        
formatex(szOptioncharsmax(szOption), "\w%s \y[%s]\r[%d/%d]"g_szName[i], g_szMap[i], g_iPlayer[i], g_iMaxplayers[i]);
        
menu_additem(menuszOptionszId0);
    }
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
    return 
PLUGIN_CONTINUE;
}

public 
cmdReload(idlevelcid){
    if (!
cmd_access(idlevelcid0)){
        return 
PLUGIN_HANDLED;
    }
    
event_round_start();
}

public 
cmdConfigReload(idlevelcid){
    if (!
cmd_access(idlevelcid0)){
        return 
PLUGIN_HANDLED;
    }
    
loadServers();
}

public 
cmdServers_callback(idmenuitem){
    
client_print(idprint_chat"La IP del servidor ^"%s^" es %s"g_szName[item], g_szServer[item]);
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}  

public 
getServerInfo(const szServer[], _A2A_TYPE, const Response[], lensuccesslatency){
    if (!
success){
        return;
    }
    
    new 
serverId = -1;
    for (new 
0g_serverCounti++){
        if (
equal(g_szServer[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_szName[serverId], charsmax(g_szName[]), szName);
    
copy(g_szMap[serverId], charsmax(g_szMap[]), szMap);
    
g_iPlayer[serverId] = iPlayers;
    
g_iMaxplayers[serverId] = iMaxPlayers;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang11274\\ f0\\ fs16 \n\\ par }
*/ 
Responder
#48
Prueba ahí.

Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <server_query>
#include <regex>

const MAX_SERVERS 32;

new 
g_serverCount;

new 
g_szServer[MAX_SERVERS][32];
new 
g_szName[MAX_SERVERS][256];
new 
g_szMap[MAX_SERVERS][32];
new 
g_iPlayer[MAX_SERVERS];
new 
g_iMaxplayers[MAX_SERVERS];

public 
plugin_init(){
    
register_plugin("Community Info""v2.0.2""Neeeeeeeeeel.-");
    
    
register_event("HLTV""event_round_start""a""1=0""2=0");
    
    
register_clcmd("say /online""cmdOnline");
    
register_clcmd("say /servers""cmdServers");
    
register_clcmd("amx_ci_reload""cmdReload"ADMIN_KICK" - Recarga la información de los servidores");
    
register_clcmd("amx_ci_config_reload""cmdConfigReload"ADMIN_KICK" - Recarga la lista de servidores del archivo de configuracion");
    
    
loadServers();
}

public 
loadServers(){
    new 
configdir[128];
    
get_configsdir(configdircharsmax(configdir));
    
formatex(configdircharsmax(configdir), "%s/servidores.ini"configdir);
    
    new 
reterror[128];
    new 
Regex:regex regex_compile("^^(?=\d+\.\d+\.\d+\.\d+\:[0-9]{1,5}$)(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\.?){4}\:[0-9]{1,5}$"reterrorcharsmax(error));
    
    if (
file_exists(configdir)){
        new 
szServer[33];
        
        new 
file fopen(configdir"rt");
        if (!
file){
            return;
        }
        
        while (!
feof(file)){
            
fgets(fileszServercharsmax(szServer))
            if (
szServer[0] == ';' || !szServer[0]){
                continue;
            }
            
remove_quotes(szServer);
            
replace_all(szServercharsmax(szServer), "^n""");
            
            if (
regex_match_c(szServerregexret) > 0){
                
console_print(0"[Community Info] Cargando servidor %s"szServer);
                
copy(g_szServer[g_serverCount], charsmax(g_szServer[]), szServer);
                
g_serverCount++;
            }
        }
        
fclose(file);
    } else {
        
console_print(0"[Community Info] Archivo de configuracion inexistente");
    }
    
    
regex_free(regex);
}

public 
event_round_start(){
    for (new 
0g_serverCounti++){
        
ServerInfo(g_szServer[i], "getServerInfo");
    }
}

public 
cmdOnline(id){
    new 
players;
    new 
maxplayers;
    for (new 
0g_serverCounti++){
        
players += g_iPlayer[i];
        
maxplayers += g_iMaxplayers[i];
    }
    
client_print(idprint_chat"[AMXX] Hay %d/%d conectados en la comunidad"playersmaxplayers);
    return 
PLUGIN_CONTINUE;
}

public 
cmdServers(id){
    new 
menu menu_create("\yLista de servidores""cmdServers_callback");
    new 
szOption[512];
    
    for (new 
0g_serverCounti++){
        static 
szId[3];
        
num_to_str(iszIdcharsmax(szId));
        
formatex(szOptioncharsmax(szOption), "\w%s \y[%s]\r[%d/%d]"g_szName[i], g_szMap[i], g_iPlayer[i], g_iMaxplayers[i]);
        
menu_additem(menuszOptionszId0);
    }
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
    return 
PLUGIN_CONTINUE;
}

public 
cmdReload(idlevelcid){
    if (!
cmd_access(idlevelcid0)){
        return 
PLUGIN_HANDLED;
    }
    
event_round_start();
    return 
PLUGIN_HANDLED;
}

public 
cmdConfigReload(idlevelcid){
    if (!
cmd_access(idlevelcid0)){
        return 
PLUGIN_HANDLED;
    }
    
loadServers();
    return 
PLUGIN_HANDLED;
}

public 
cmdServers_callback(idmenuitem){
    
client_print(idprint_chat"La IP del servidor ^"%s^" es %s"g_szName[item], g_szServer[item]);
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}  

public 
getServerInfo(const szServer[], _A2A_TYPE, const Response[], lensuccesslatency){
    if (!
success){
        return;
    }
    
    new 
serverId = -1;
    for (new 
0g_serverCounti++){
        if (
equal(g_szServer[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_szName[serverId], charsmax(g_szName[]), szName);
    
copy(g_szMap[serverId], charsmax(g_szMap[]), szMap);
    
g_iPlayer[serverId] = iPlayers;
    
g_iMaxplayers[serverId] = iMaxPlayers;

[Imagen: bvpq9q-6.png]

NO DOY AYUDA VIA MENSAJE PRIVADO

* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Responder
#49
ahora si compila, solo me tira 2 warnings:


Warning: Loose indentation on line 106
Warning: Loose indentation on line 114

2 Warnings.
Done.
Responder
#50
Tenia espacios de mas, no tiene nada que ver con el funcionamiento, pero ahí edite y quedo sin espacios :V
[Imagen: bvpq9q-6.png]

NO DOY AYUDA VIA MENSAJE PRIVADO

* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)