Problema con conexión mysql
#1
Tengo un muy raro error que me volvió loco así que veo si me pueden dar una mano.

Tengo:
Código PHP:
#define MYSQL_HOST "127.0.0.1"
#define MYSQL_USER "Global"
#define MYSQL_PASS "testparaaliedmodders" 
#define MYSQL_DB "zombieplague" 

Código PHP:
// Sql
new TABLE[] = "cuentas"
new Handle:SqlTpl 
new Handle:g_Mysql 

y en wamp tengo la database zombieplague, el usuario global con permisos seteados al 100%, con esa password. que adentro tiene la tabla cuentas;

donde esta el tema?
al iniciar el hlds (steamcmd) si tengo prendido el wamp (en teoría, si se logra conectar a la db) se cierra automáticamente y no deja ningún log.

pero en cambio, si al iniciar el hlds tengo apagado el wamp, entonces inicia pero obviamente no conecta a la database y por ende el plugin se cierra...

es muy extraño, alguien puede darme una mano?
Responder
#2
El HLDS no deja ningun log y se cierra?

Y bueno que si no pasas code dificil que captemos en que punto hay un quiebre
Responder
#3
Absolutamente ningún log y se cierra.

Código PHP:
public mysql_init() 

    
stop_save 0
    
    
new szError[256], iError 
    
    SqlTpl 
SQL_MakeDbTuple(MYSQL_HOSTMYSQL_USERMYSQL_PASSMYSQL_DB);
    
g_Mysql SQL_Connect(SqlTpliErrorszErrorsizeof szError ) - 1)      
    
    if(!
g_Mysql)
    {
        
server_cmd("sv_password dboff")
        
server_print("%s"szError)
        
set_fail_state("[ZP] ERROR EN LA BASE DE DATOS")
    }
    else
        
server_cmd("sv_password ^"^"")
    
    
//set_task(300.0, "savedata")
}

// Create Account
public clcmd_create(id)
{
    new 
Handle:User SQL_PrepareQueryg_Mysql"SELECT `name` FROM `%s` WHERE `name` = '%s'"TABLEg_playername[id]) 
    
SQL_ExecuteUser 
    new 
szBuffer33 ];
    
    while (
SQL_MoreResults(User)) 
    { 
        
SQL_ReadResultUser0szBuffersizeof szBuffer ) - 
        
SQL_FreeHandleUser 
        break;
    }
    
    if(
equali(g_playername[id] , szBuffer))
    {
        
set_hudmessage(02550, -1.0, -1.006.020.0)
        
show_hudmessage(id"La Cuenta con la que deseas Registrarte ya esta en Uso^nPrueba con otra!!")
        
        
show_menu_reg(id)
        
        return 
PLUGIN_HANDLED
    
}
    
    else
    {
        
client_cmd(id"messagemode WRITE_PASSWORD")
        
        
set_hudmessage(025500.010.0406.012.0)
        
show_hudmessage(id"Escribi un Contraseña para tu Cuenta")
        
    }
    return 
PLUGIN_CONTINUE
}

// Create Password
public clcmd_passid )
{    
    
read_args(g_iPasswordcharsmax(g_iPassword))
    
remove_quotes(g_iPassword)
    
trim(g_iPassword)
    
    if(
equal(g_iPassword"") || contain(g_iPassword" ") != -1)
    {
        
client_cmd(id"messagemode WRITE_PASSWORD")
        return 
PLUGIN_HANDLED
    
}
    
    
copy(g_iPlayerPasswordid ], charsmax(g_iPlayerPassword), g_iPassword)
    
    
set_hudmessage(025500.010.0406.012.0)
    
show_hudmessage(id"Volve a escribir la Contraseña")
    
    
client_cmd(id"messagemode CONFIRM_PASSWORD")
    
    return 
PLUGIN_HANDLED
}

// Confirm Password
public clcmd_comfirmpassid )
{
    
read_args(g_iPasswordcharsmax(g_iPassword))
    
remove_quotes(g_iPassword)
    
trim(g_iPassword)
    
    if(
equal(g_iPassword"") || contain(g_iPassword" ") != -1)
    {
        
set_hudmessage(025500.010.0406.012.0)
        
show_hudmessage(id"La Contraseña no coincide con la Anterior^nIntenta denuevo")
        
        
client_cmd(id"messagemode WRITE_PASSWORD")
        return 
PLUGIN_HANDLED
    
}
    
    
copy(g_iPlayerCPid ], charsmax(g_iPlayerCP), g_iPassword)
    
    if(
equal(g_iPlayerCPid ] , g_iPlayerPasswordid ]))
    {
        
set_hudmessage(02550, -1.0, -1.016.012.0)
        
show_hudmessage(id"Has sido Registrado correctamente!!")
        
        
check(id)
        
        for(new 
i5i++)
            
client_print(idprint_chat"Cuenta: %s | Contraseña: %s"g_playername[id], g_iPlayerCP[id])
        
        
CreateNewAccount(id)
        return 
PLUGIN_CONTINUE
    
}
    else
    {
        
set_hudmessage(025500.010.0406.012.0)
        
show_hudmessage(id"La Contraseña no coincide con la Anterior^nIntenta denuevo")
        
        
client_cmd(id"messagemode WRITE_PASSWORD")
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED
}

CreateNewAccountid )
{
    new 
Handle:User SQL_PrepareQueryg_Mysql"SELECT `name` FROM `%s` WHERE `name` = '%s'"TABLEg_playername[id] ) 
    
SQL_ExecuteUser 
    new 
szBuffer33 ];
    
    while ( 
SQL_MoreResultsUser ) ) 
    { 
        
SQL_ReadResultUser0szBuffersizeof szBuffer ) - 
        
SQL_FreeHandleUser 
        break 
    }
    
    if(!
equal(szBufferg_playername[id] ))
    {
        new 
Handle:Update SQL_PrepareQueryg_Mysql"INSERT INTO `%s`(`name`, `pass`) VALUES ('%s','%s')"TABLEg_playername[id], g_iPlayerPassword[id] ) 
        
SQL_ExecuteUpdate 
        
SQL_FreeHandleUpdate )
        
        
client_cmd(id"setinfo ^"%s^" ^"%s^""iFieldPassg_iPlayerPasswordid ])
        
        
g_iRegistredid ] = 1;
        
g_iValidPassid ] = g_iPassword
        
        show_menu_ch
id );
    }
    else
    {
        
set_hudmessage(02550, -1.0, -1.006.020.0)
        
show_hudmessage(id"La Cuenta con la que deseas Registrarte ya esta en Uso^nPrueba con otra!!")
        
        
client_cmd(id"messagemode WRITE_PASSWORD")
        
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}

/* ================================================================
[ Login Account ]
===============================================================*/
public clcmd_loginaccid )
{
    new 
Handle:User SQL_PrepareQueryg_Mysql"SELECT `name` FROM `%s` WHERE `name` = '%s'"TABLEg_playername[id]) 
    
SQL_ExecuteUser 
    new 
szBuffer33 ];
    
    while ( 
SQL_MoreResultsUser ) ) 
    { 
        
SQL_ReadResultUser0szBuffersizeof szBuffer ) - 
        
SQL_FreeHandleUser 
        break 
    }
    
    if( 
equal(g_playername[id] , szBuffer) )
    {
        
client_cmd(id"messagemode LOGIN_PASSWORD")
        
        
set_hudmessage(025500.010.0406.012.0)
        
show_hudmessage(id"Ingresa la Contraseña de tu Cuenta")
        
        return 
PLUGIN_CONTINUE;
    }
    else
    {
        
set_hudmessage(02550, -1.0, -1.006.015.0)
        
show_hudmessage(id"La Cuenta con la que deseas Ingresar no Existe!!")
        
        
show_menu_reg(id)
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED;
}

public 
clcmd_loginpassid )
{
    
read_args(g_iPasswordcharsmax(g_iPassword))
    
remove_quotes(g_iPassword)
    
trim(g_iPassword)
    
    new 
Handle:Check SQL_PrepareQueryg_Mysql"SELECT `pass` FROM `%s` WHERE `name` = '%s'"TABLEg_playername[id]) 
    
SQL_ExecuteCheck 
    new 
szBuffer33 ];
    
    while ( 
SQL_MoreResultsCheck ) ) 
    { 
        
SQL_ReadResultCheck0szBuffersizeof szBuffer ) - 
        
SQL_FreeHandleCheck 
        break 
    }
    
    if(
equal(szBuffer g_iPassword))
    {
        
LoadDatos(id)
        
        
g_iRegistredid ] = 1;
        
g_iValidPassid ] = szBuffer;
        
        
set_user_info(id,"setinfo _sql",g_iValidPass[id])
        
        
show_menu_chid )
        
        
set_hudmessage(02550, -1.0, -1.006.01.0)
        
show_hudmessage(id"CARGANDO")
        
        return 
PLUGIN_HANDLED
    
}
    else
    {    
        
set_hudmessage(025500.010.0406.015.0)
        
show_hudmessage(id"La Contraseña no coincide con la Registrada^nIntenta denuevo")
        
        
client_cmd(id"messagemode LOGIN_PASSWORD")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED


y cuando guarda y carga datos:

Código PHP:
SaveDatos(id)
{
    if(
g_ammopacks[id] <= || g_level[id] == 0)
        return;
    
    static 
szQuery[400]
    
    new 
SZ_Data[512], SZ_Data1[512]
    
    
formatex(SZ_Datacharsmax(SZ_Data), "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d"g_logros[id][3], g_logros[id][4], g_logros[id][5], g_logros[id][6], g_logros[id][7], g_logros[id][8], g_logros[id][9], g_logros[id][10], g_logros[id][11], g_logros[id][12], g_logros[id][13], g_logros[id][14], g_logros[id][15], g_logros[id][16], g_logros[id][17], g_logros[id][18])
    
formatex(SZ_Data1charsmax(SZ_Data1), "%d %d %d %d"g_color[id][COLOR_NVG], g_color[id][COLOR_HUD], g_color[id][COLOR_FLARE], g_color[id][COLOR_LINTERNA])
    
    
formatex(szQuery399"UPDATE `%s` SET `ammopacks` = '%d', `reset` = '%d', `puntos` = '%d', `vidaH` = '%d', `chalecoH` = '%d', `speedH` = '%d', `gravH` = '%d', `damageH` = '%d', `vidaZ` = '%d', `speedZ` = '%d', `gravZ` = '%d', `damageZ` = '%d', `colores` = '%s', `logros` = '%s' WHERE `name` = '%s'",
    
TABLEg_ammopacks[id], g_reset[id], g_puntos[id], g_vidaH[id], g_chalecoH[id], g_speedH[id], g_grav_levelH[id], g_damage_levelH[id], g_vidaZ[id], g_speedZ[id], g_grav_levelZ[id], g_damage_levelZ[id], SZ_Data1SZ_Datag_playername[id]);
    
    
SQL_ThreadQuery(SqlTpl"QuerySetData"szQuery);
}

LoadDatos(id)
{
    static 
szQuery[400], iData[1]; 
    
formatex(szQuery399"SELECT `ammopacks`, `reset`, `puntos`, `vidaH`, `chalecoH`, `speedH`, `gravH`, `damageH`, `vidaZ`, `speedZ`, `gravZ`, `damageZ`, `colores`, `logros` FROM `%s` WHERE ( `name` = '%s' );"TABLEg_playername[id]); 
    
    
iData[0] = id;
    
SQL_ThreadQuery(SqlTpl"QuerySelectData"szQueryiData1);
}

public 
QuerySelectDataiFailStateHandle:hQueryszError[ ], iErroriData[ ], iDataSizeFloat:fQueueTime 

    if( 
iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED 
    { 
        
log_amx"%s"szError );
        
        return;
    } 
    else
    { 
        new 
id iData];
        new 
logro_[100], colores_[33]
        
        new 
ColAmmopacks SQL_FieldNameToNum(hQuery"ammopacks")
        new 
ColReset SQL_FieldNameToNum(hQuery"reset")
        new 
ColPuntos SQL_FieldNameToNum(hQuery"puntos")
        new 
ColVidaH SQL_FieldNameToNum(hQuery"vidaH")
        new 
ColChalecoH SQL_FieldNameToNum(hQuery"chalecoH")
        new 
ColSpeedH SQL_FieldNameToNum(hQuery"speedH")
        new 
ColGravH SQL_FieldNameToNum(hQuery"gravH")
        new 
ColDamageH SQL_FieldNameToNum(hQuery"damageH")
        new 
ColVidaZ SQL_FieldNameToNum(hQuery"vidaZ")
        new 
ColSpeedZ SQL_FieldNameToNum(hQuery"speedZ")
        new 
ColGravZ SQL_FieldNameToNum(hQuery"gravZ")
        new 
ColDamageZ SQL_FieldNameToNum(hQuery"damageZ")
        new 
ColColores SQL_FieldNameToNum(hQuery"colores")
        new 
ColLogro SQL_FieldNameToNum(hQuery"logros")
        
        while (
SQL_MoreResults(hQuery)) 
        {
            
g_ammopacks[id] = SQL_ReadResult(hQueryColAmmopacks);
            
g_reset[id] = SQL_ReadResult(hQueryColReset);
            
g_puntos[id] = SQL_ReadResult(hQueryColPuntos);    
            
g_vidaH[id] = SQL_ReadResult(hQueryColVidaH);    
            
g_chalecoH[id] = SQL_ReadResult(hQueryColChalecoH);    
            
g_speedH[id] = SQL_ReadResult(hQueryColSpeedH);    
            
g_grav_levelH[id] = SQL_ReadResult(hQueryColGravH);    
            
g_damage_levelH[id] = SQL_ReadResult(hQueryColDamageH);    
            
g_vidaZ[id] = SQL_ReadResult(hQueryColVidaZ);    
            
g_speedZ[id] = SQL_ReadResult(hQueryColSpeedZ);    
            
g_grav_levelZ[id] = SQL_ReadResult(hQueryColGravZ)
            
g_damage_levelZ[id] = SQL_ReadResult(hQueryColDamageZ);
            
SQL_ReadResult(hQueryColColorescolores_charsmax(colores_));
            
SQL_ReadResult(hQueryColLogrologro_charsmax(logro_));
            
            
SQL_NextRow(hQuery)
        } 
        
        new 
logros[16], colores[4]
        
str_to_arraynum(logro_logros15)
        
str_to_arraynum(colores_colores3)
        
        for(new 
0<= 15i++)
            
g_logros[id][i+3] = logros[i]
        
        for(new 
0<= 3l++)
            
g_color[id][COLOR_NVG+l] = colores[l]
        
        
check(id)
    }
}

public 
QuerySetDataiFailStateHandle:hQueryszError[ ], iErroriData[ ], iDataSizeFloat:fQueueTime 

    if( 
iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED 
    { 
        
log_amx"%s"szError ); 
        
        return;
    } 

Responder
#4
No sirve el codigo que diste. Por como indicas el error no es de la MySQL. La DB no es capaz de tirar un server con consultas simples, y dudo que alcanse a ejecutarse alguna debido a que se cierra inesperadamente el proceso. Algo debe estar pasando despues de mysql_init, haz debug, guarda textos en logs, investiga el code. Es lo que puedo decir si no pasas code Whatever
Responder
#5
(02/01/2015, 11:41 PM)meTaLiCroSS escribió: No sirve el codigo que diste. Por como indicas el error no es de la MySQL. La DB no es capaz de tirar un server con consultas simples, y dudo que alcanse a ejecutarse alguna debido a que se cierra inesperadamente el proceso. Algo debe estar pasando despues de mysql_init, haz debug, guarda textos en logs, investiga el code. Es lo que puedo decir si no pasas code Whatever

Y pero si no es la mysql porque si desactivo el wamp si arranca..

que parte en especial necesitas?
Responder
#6
(02/01/2015, 11:43 PM)ilhianois escribió:
(02/01/2015, 11:41 PM)meTaLiCroSS escribió: No sirve el codigo que diste. Por como indicas el error no es de la MySQL. La DB no es capaz de tirar un server con consultas simples, y dudo que alcanse a ejecutarse alguna debido a que se cierra inesperadamente el proceso. Algo debe estar pasando despues de mysql_init, haz debug, guarda textos en logs, investiga el code. Es lo que puedo decir si no pasas code Whatever

Y pero si no es la mysql porque si desactivo el wamp si arranca..

que parte en especial necesitas?


Y es obvio que si desactivas el WAMP arrancara debido a que "set_fail_state" cortará el proceso del plugin y no se seguira ejecutando nada en el caso de no encontrarse una conexion valida.

No sabria decirte magicamente que parte en especial necesito por que no se como esta estructurado tu plugin. No hay mil ojos que busquen tu plugin, ni nada innovador a estas fechas que sea tan privado tu plugin.

Y habilita PM si me envias y esperes que te responda :p
Responder
#7
(02/01/2015, 11:52 PM)meTaLiCroSS escribió:
(02/01/2015, 11:43 PM)ilhianois escribió:
(02/01/2015, 11:41 PM)meTaLiCroSS escribió: No sirve el codigo que diste. Por como indicas el error no es de la MySQL. La DB no es capaz de tirar un server con consultas simples, y dudo que alcanse a ejecutarse alguna debido a que se cierra inesperadamente el proceso. Algo debe estar pasando despues de mysql_init, haz debug, guarda textos en logs, investiga el code. Es lo que puedo decir si no pasas code Whatever

Y pero si no es la mysql porque si desactivo el wamp si arranca..

que parte en especial necesitas?


Y es obvio que si desactivas el WAMP arrancara debido a que "set_fail_state" cortará el proceso del plugin y no se seguira ejecutando nada en el caso de no encontrarse una conexion valida.

No sabria decirte magicamente que parte en especial necesito por que no se como esta estructurado tu plugin. No hay mil ojos que busquen tu plugin, ni nada innovador a estas fechas que sea tan privado tu plugin.

Y habilita PM si me envias y esperes que te responda :p

Claro tenes razón totalmente.

Ahí habilité.
Responder
#8
Bumpeo a pedido de metalicross.

Le pase el code, lo leyo, esta todo bien.

El modules .ini perfecto, los models estan, todo está.

log CON ZP Y WAMP:
Código PHP:
Console initialized.
Base networking initialized.
"sv_cheats" changed to "1"
Initializing deltas
Protocol version 48
Exe version 1.1.2.7 
(cstrike)
Exe build13:13:28 Aug 29 2013 (6153)
40.0 Mb heap
execing valve
.rc
execing language
.cfg
execing autoexec
.cfg
execing violence
.cfg
Server IP address 192.168.1.100
:27015

Adding
:  cstrike/addons\metamod\dlls\metamod.dll
   
   Metamod version 1.21.1
-am  Copyright (c2001-2013 Will Day <willday@metamod.org>
   
Metamod comes with ABSOLUTELY NO WARRANTY; for details type `meta gpl'.
   This is free software, and you are welcome to redistribute it
   under certain conditions; type 
`meta gpl' for details.
   
Version 0.9.391 Windows

   AMX Mod X version 1.8.2 Copyright (c) 2004-2006 AMX Mod X Development Team 
   AMX Mod X comes with ABSOLUTELY NO WARRANTY; for details type `amxx gpl'
.
   
This is free software and you are welcome to redistribute it under 
   certain conditions
type 'amxx gpl' for details.
  
Dll loaded for mod Counter-Strike
Spawn Server de_aztec
Clearing memory
Texture load
:    0.5ms
WARNING
failed to locate sequence file de_aztec
Building PAS
...
Average leaves visible audible total103 294 800
L 01
/03/2015 00:48:05: -------- Mapchange to de_aztec --------
"amxmodx_version" changed to "1.8.2" 

CON ZP SIN WAMP:
Código PHP:
Console initialized.
Base networking initialized.
"sv_cheats" changed to "1"
Initializing deltas
Protocol version 48
Exe version 1.1.2.7 
(cstrike)
Exe build13:13:28 Aug 29 2013 (6153)
40.0 Mb heap
execing valve
.rc
execing language
.cfg
execing autoexec
.cfg
execing violence
.cfg
Server IP address 192.168.1.100
:27015

Adding
:  cstrike/addons\metamod\dlls\metamod.dll
   
   Metamod version 1.21.1
-am  Copyright (c2001-2013 Will Day <willday@metamod.org>
   
Metamod comes with ABSOLUTELY NO WARRANTY; for details type `meta gpl'.
   This is free software, and you are welcome to redistribute it
   under certain conditions; type 
`meta gpl' for details.
   
Version 0.9.391 Windows

   AMX Mod X version 1.8.2 Copyright (c) 2004-2006 AMX Mod X Development Team 
   AMX Mod X comes with ABSOLUTELY NO WARRANTY; for details type `amxx gpl'
.
   
This is free software and you are welcome to redistribute it under 
   certain conditions
type 'amxx gpl' for details.
  
Dll loaded for mod Counter-Strike
Spawn Server de_aztec
Clearing memory
Texture load
:    0.4ms
WARNING
failed to locate sequence file de_aztec
Building PAS
...
Average leaves visible audible total103 294 800
L 01
/03/2015 00:49:48: -------- Mapchange to de_aztec --------
"amxmodx_version" changed to "1.8.2"
Can't connect to MySQL server on '127.0.0.1' (10061)
L 01/03/2015 - 00:49:49: [AMXX] Plugin ("zpp.amxx") is setting itself as failed.
L 01/03/2015 - 00:49:49: [AMXX] Plugin says: [ZPFB] ERROR EN LA BASE DE DATOS
L 01/03/2015 - 00:49:49: [AMXX] Run time error 1 (plugin "zpp.amxx") - forced exit
"sv_maxspeed" changed to "900"
Cvar_Set: variable room_type not found
"sv_password" changed to "***PROTECTED***"

GAME SKILL LEVEL:1
Cvar_Set: variable cl_himodels not found
"pausable" changed to "0"
0 entities inhibited
[AMXX] Loaded 1 admin from file
"amx_language" changed to "en"
"amx_client_languages" changed to "1"
"amx_nextmap" changed to "de_airstrip"
"sv_accelerate" changed to "5"
"sv_stopspeed" changed to "75"
24 player server started
execing addons/amxmodx/configs/amxx.cfg
Executing AMX Mod X Configuration File 
Scrolling message displaying frequency: 10:00 minutes
execing addons/amxmodx/configs/sql.cfg
execing addons/amxmodx/configs/custommenuitems.cfg
Sys_InitializeGameDLL called twice, skipping second call
execing config.cfg
Server logging data to file logs\L0103002.log
L 01/03/2015 - 00:49:50: Log file started (file "logs\L0103002.log") (game "cstrike") (version "48/1.1.2.7/6153")
execing server.cfg
L 01/03/2015 - 00:49:50: Server cvar "sv_aim" = "0"
"sv_aim" changed to "0"
L 01/03/2015 - 00:49:50: Server cvar "sv_maxspeed" = "320"
"sv_maxspeed" changed to "320"
L 01/03/2015 - 00:49:50: Server cvar "mp_timelimit" = "20"
"mp_timelimit" changed to "20"
L 01/03/2015 - 00:49:50: Server cvar "sv_cheats" = "0"
"sv_cheats" changed to "0"
couldn'
t exec listip.cfg
couldn
't exec banned.cfg
Menu item 17 added to Menus Front-End: "Plugin Cvars" from plugin "pluginmenu.amxx"
Menu item 18 added to Menus Front-End: "Plugin Commands" from plugin "pluginmenu.amxx"
Connection to Steam servers successful.
   VAC secure mode is activated. 

SIN ZP:
Código PHP:
Console initialized.
Base networking initialized.
"sv_cheats" changed to "1"
Initializing deltas
Protocol version 48
Exe version 1.1.2.7 
(cstrike)
Exe build13:13:28 Aug 29 2013 (6153)
40.0 Mb heap
execing valve
.rc
execing language
.cfg
execing autoexec
.cfg
execing violence
.cfg
WARNING
UDP_OpenSocketport27015  bindWSAEADDRINUSE 
Responder
#9
Si metalicross no te pudo ayudar sin el code, los demás tampoco Whatever postéalo para que podamos ayudarte.
Responder
#10
Alguna verga rara hay entre precache e init. Utiliza server_print en muchos puntos entre esas 3 funciones y con condebug vas revisando hasta que punto llegan los mensajes, para ver la posible ultima funcion que se ejecuta antes que se caiga.
Responder
#11
Estuve probando lo del server_print y llegué a esto:

Código PHP:
// Allow registering stuff now
    
g_arrays_created true
    
    
// Load customization data
    
load_customization_from_files()
    
    new 
ibuffer[100]
    
// Load up the hard coded extra items
    
native_register_extra_item2("NightVision"g_extra_costs2[EXTRA_NVISION], ZP_TEAM_HUMAN)
    
native_register_extra_item2("T-Virus Antidote"g_extra_costs2[EXTRA_ANTIDOTE], ZP_TEAM_ZOMBIE)
    
native_register_extra_item2("Zombie Madness"g_extra_costs2[EXTRA_MADNESS], ZP_TEAM_ZOMBIE)
    
native_register_extra_item2("Infection Bomb"g_extra_costs2[EXTRA_INFBOMB], ZP_TEAM_ZOMBIE)

    
// Extra weapons
    
for (0ArraySize(g_extraweapon_names); i++)
    {
        
ArrayGetString(g_extraweapon_namesibuffercharsmax(buffer))
        
native_register_extra_item2(bufferArrayGetCell(g_extraweapon_costsi), ZP_TEAM_HUMAN)
    }


       
// SI PONGO EL SERVER_PRINT ACÁ, ME LO LLEGA A ESCRIBIR EN EL qconsole.log


    // Custom player models
    
for (0ArraySize(model_nemesis); i++)
    {
        
ArrayGetString(model_nemesisibuffercharsmax(buffer))
        
format(buffercharsmax(buffer), "models/player/%s/%s.mdl"bufferbuffer)
        
ArrayPushCell(g_modelindex_nemesisprecache_model(buffer))
        if (
g_force_consistency == 1force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
        if (
g_force_consistency == 2force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
    }

        
// SI LO PONGO ACÁ, YA NO LLEGA A ESCRIBIR EL qconsole.log

    
for (0ArraySize(model_survivor); i++)
    {
        
ArrayGetString(model_survivoribuffercharsmax(buffer))
        
format(buffercharsmax(buffer), "models/player/%s/%s.mdl"bufferbuffer)
        
ArrayPushCell(g_modelindex_survivorprecache_model(buffer)) 
        if (
g_force_consistency == 1force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
        if (
g_force_consistency == 2force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
    }
    for (
0ArraySize(model_sniper); i++)
    {
        
ArrayGetString(model_sniperibuffercharsmax(buffer))
        
format(buffercharsmax(buffer), "models/player/%s/%s.mdl"bufferbuffer)
        
ArrayPushCell(g_modelindex_sniperprecache_model(buffer)) 
        if (
g_force_consistency == 1force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
        if (
g_force_consistency == 2force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
    }
    for (
0ArraySize(model_ninja); i++)
    {
        
ArrayGetString(model_ninjaibuffercharsmax(buffer))
        
format(buffercharsmax(buffer), "models/player/%s/%s.mdl"bufferbuffer)
        
ArrayPushCell(g_modelindex_ninjaprecache_model(buffer)) 
        if (
g_force_consistency == 1force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
        if (
g_force_consistency == 2force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
    }
    for (
0ArraySize(model_executioner); i++)
    {
        
ArrayGetString(model_executioneribuffercharsmax(buffer))
        
format(buffercharsmax(buffer), "models/player/%s/%s.mdl"bufferbuffer)
        
ArrayPushCell(g_modelindex_executionerprecache_model(buffer)) 
        if (
g_force_consistency == 1force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
        if (
g_force_consistency == 2force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
    }
    for (
0ArraySize(model_alienboss); i++)
    {
        
ArrayGetString(model_alienbossibuffercharsmax(buffer))
        
format(buffercharsmax(buffer), "models/player/%s/%s.mdl"bufferbuffer)
        
ArrayPushCell(g_modelindex_alienbossprecache_model(buffer)) 
        if (
g_force_consistency == 1force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
        if (
g_force_consistency == 2force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
    }
    for (
0ArraySize(model_alienjunior); i++)
    {
        
ArrayGetString(model_alienjunioribuffercharsmax(buffer))
        
format(buffercharsmax(buffer), "models/player/%s/%s.mdl"bufferbuffer)
        
ArrayPushCell(g_modelindex_alienjuniorprecache_model(buffer)) 
        if (
g_force_consistency == 1force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
        if (
g_force_consistency == 2force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
    }
    for (
0ArraySize(model_admin_zombie); i++)
    {
        
ArrayGetString(model_admin_zombieibuffercharsmax(buffer))
        
format(buffercharsmax(buffer), "models/player/%s/%s.mdl"bufferbuffer)
        
ArrayPushCell(g_modelindex_admin_zombieprecache_model(buffer))
        if (
g_force_consistency == 1force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
        if (
g_force_consistency == 2force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
    }
    for (
0ArraySize(model_admin_human); i++)
    {
        
ArrayGetString(model_admin_humanibuffercharsmax(buffer))
        
format(buffercharsmax(buffer), "models/player/%s/%s.mdl"bufferbuffer)
        
ArrayPushCell(g_modelindex_admin_humanprecache_model(buffer))
        if (
g_force_consistency == 1force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
        if (
g_force_consistency == 2force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
    } 

Tengo así el customization file:
Código PHP:
[Player Models] (randomly chosen if more than one)
ALIEN_BOSS AlienBoss2
ALIEN_JUNIOR 
AlienJunior
NEMESIS 
nemesis2
SNIPER 
Sniper
NINJA 
ninja
EXECUTIONER 
executioner
SURVIVOR 
survi2
ADMIN ZOMBIE 
zombie_source
ADMIN HUMAN 
arctic 

Será que en vez de AlienBoss2, AlienJunior, y étc debería poner la ruta al model?
Responder
#12
Pon prints dentro del loop que esta cortando el proceso
Responder
#13
Acá estamo:

Código PHP:
for (0ArraySize(model_nemesis); i++)
    {
        
ArrayGetString(model_nemesisibuffercharsmax(buffer))
        
format(buffercharsmax(buffer), "models/player/%s/%s.mdl"bufferbuffer)
        
ArrayPushCell(g_modelindex_nemesisprecache_model(buffer))  // SI LO PONGO ANTES DE ESTA LINEA, LO ESCRIBE. DESPUÉS, YA NO.
        
if (g_force_consistency == 1force_unmodified(force_model_samebounds, {0,0,0}, {0,0,0}, buffer)
        if (
g_force_consistency == 2force_unmodified(force_exactfile, {0,0,0}, {0,0,0}, buffer)
    } 
Responder
#14
Haz print de la variable "buffer" antes de la linea que verificaste.
Responder
#15
Lo hice y este es el qconsole:

Código PHP:
Console initialized.
Base networking initialized.
"sv_cheats" changed to "1"
Initializing deltas
Protocol version 48
Exe version 1.1.2.7 
(cstrike)
Exe build13:13:28 Aug 29 2013 (6153)
40.0 Mb heap
execing valve
.rc
execing language
.cfg
execing autoexec
.cfg
execing violence
.cfg
Server IP address 192.168.1.100
:27015

Adding
:  cstrike/addons\metamod\dlls\metamod.dll
   
   Metamod version 1.21.1
-am  Copyright (c2001-2013 Will Day <willday@metamod.org>
   
Metamod comes with ABSOLUTELY NO WARRANTY; for details type `meta gpl'.
   This is free software, and you are welcome to redistribute it
   under certain conditions; type 
`meta gpl' for details.
   
Version 0.9.391 Windows

   AMX Mod X version 1.8.2 Copyright (c) 2004-2006 AMX Mod X Development Team 
   AMX Mod X comes with ABSOLUTELY NO WARRANTY; for details type `amxx gpl'
.
   
This is free software and you are welcome to redistribute it under 
   certain conditions
type 'amxx gpl' for details.
  
Dll loaded for mod Counter-Strike
Spawn Server de_aztec
Clearing memory
Texture load
:    0.4ms
WARNING
failed to locate sequence file de_aztec
Building PAS
...
Average leaves visible audible total103 294 800
L 01
/03/2015 16:46:22: -------- Mapchange to de_aztec --------
"amxmodx_version" changed to "1.8.2"
models/player/nemesis2/nemesis2.mdl 
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)