Raised This Month: $51 Target: $400
 12% 

[ZP] Debug en Cur_Weapon & SQlite


  
 
 
Thread Tools Display Modes
Author Message
GalaxyA
BANNED
Join Date: Sep 2012
Location: Noob Member
Old 12-19-2012 , 00:11   [ZP] Debug en Cur_Weapon & SQlite
#1

Code:
L 12/18/2012 - 22:48:13: [AMXX] Displaying debug trace (plugin "zombie_plague40.amxx") L 12/18/2012 - 22:48:13: [AMXX] Run time error 10: native error (native "cs_set_weapon_ammo") L 12/18/2012 - 22:48:13: [AMXX]    [0] zombie_plague40.sma::fm_cs_get_current_weapon_ent (line 17934) L 12/18/2012 - 22:48:13: [AMXX]    [1] zombie_plague40.sma::message_cur_weapon (line 8543) L 12/18/2012 - 23:00:44: Start of error session. L 12/18/2012 - 23:00:44: Info (map "zm_dark2[ZP_GALAXY]") (file "addons/amxmodx/logs/error_20121218.log") L 12/18/2012 - 23:00:44: [SQLITE] No result set in this query! L 12/18/2012 - 23:00:44: [AMXX] Displaying debug trace (plugin "zombie_plague40.amxx") L 12/18/2012 - 23:00:44: [AMXX] Run time error 10: native error (native "SQL_FieldNameToNum") L 12/18/2012 - 23:00:44: [AMXX]    [0] zombie_plague40.sma::QuerySelectData (line 2277)

Codigo & Lineas:
PHP Code:
// Current Weapon info
public message_cur_weapon(msg_idmsg_destmsg_entity)
{
    
// Not alive or zombie
    
if (!g_isalive[msg_entity] || g_zombie[msg_entity])
        return;
    
    
// Not an active weapon
    
if (get_msg_arg_int(1) != 1)
        return;
    
    
// Unlimited clip disabled for class
    
if (g_has_unlimited_clip[msg_entity])
        return;
    
    
// Get weapon's id
    
static weapon
    weapon 
get_msg_arg_int(2)
    
    
// Unlimited Clip Ammo for this weapon?
    
if (MAXBPAMMO[weapon] > 2)
    {
        
// Max out clip ammo
        
cs_set_weapon_ammo(fm_cs_get_current_weapon_ent(msg_entity), MAXCLIP[weapon]) // Error Linea 8543
        
        // HUD should show full clip all the time
        
set_msg_arg_int(3get_msg_argtype(3), MAXCLIP[weapon])
    }

PHP Code:
// Get User Current Weapon Entity
stock fm_cs_get_current_weapon_ent(id)
{
    
// Prevent server crash if entity's private data not initalized
    
if (pev_valid(id) != PDATA_SAFE)
        return -
1;
    
    return 
get_pdata_cbase(idOFFSET_ACTIVE_ITEMOFFSET_LINUX); // Error Linea 17934

PHP Code:
public QuerySelectData(iFailStateHandle:hQueryszError[ ], iErroriData[ ], iDataSizeFloat:fQueueTime )

    static 
id
    
id iData]; 
     
    if( !
is_user_connected(id)) 
        return 
PLUGIN_HANDLED 
     
    
switch( iFailState 
    { 
        case 
TQUERY_CONNECT_FAILED
        { 
            
log_to_file"SQL_LOG_TQ.txt""Error en la conexion al MySQL QuerySelectData [%i]: %s"iErrorszError ); 
            return 
PLUGIN_CONTINUE
        } 
// Error Linea 2277
        
case TQUERY_QUERY_FAILED
            
log_to_file"SQL_LOG_TQ.txt""Error en la consulta al MySQL QuerySelectData [%i]: %s"iErrorszError ); 
    } 
     
    static 
Col_pun_mej_hi
    
static Col_colores

    Col_pun_mej_h 
SQL_FieldNameToNum(hQuery"Mejoras"
    
Col_colores SQL_FieldNameToNum(hQuery"Colores"
         
    while(
SQL_MoreResults(hQuery)){ 

        
SQL_ReadResult(hQueryCol_pun_mej_hstr_pun_mej_h30
        
SQL_ReadResult(hQueryCol_coloresstr_colores150
        
SQL_NextRow(hQuery
    } 
     
    static 
mejoras_hSQL[4][4]
    static 
colores_SQL[15][4]

    
parse(str_pun_mej_hmejoras_hSQL[0], 3mejoras_hSQL[1], 3mejoras_hSQL[2], 3mejoras_hSQL[3], 3)
    
parse(str_colorescolores_SQL[0], 3colores_SQL[1], 3colores_SQL[2], 3colores_SQL[3], 3colores_SQL[4], 3colores_SQL[5], 3colores_SQL[6], 3colores_SQL[7], 3colores_SQL[8], 3colores_SQL[9], 3colores_SQL[10], 3colores_SQL[11], 3colores_SQL[12], 3colores_SQL[13], 3colores_SQL[14], 3)

    for(
04i++)
        
g_mejoras[id][i] = str_to_num(mejoras_hSQL[i])
        
    for(
015i++)
        
Colores[id][i] = str_to_num(colores_SQL[i])

    
SQL_FreeHandle(hQuery
    return 
PLUGIN_CONTINUE


Last edited by GalaxyA; 12-19-2012 at 11:27.
GalaxyA is offline
Send a message via MSN to GalaxyA
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 12-19-2012 , 12:00   Re: [ZP] Debug en Cur_Weapon & SQlite
#2

para lo 2do.. paracen boludos..

https://forums.alliedmods.net/showthread.php?t=202495

edit: alguien me puede explicar para que sirve SQL_FieldNameToNum.. no le encuentro sentido
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 12-19-2012 at 12:08.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 12-19-2012 , 17:35   Re: [ZP] Debug en Cur_Weapon & SQlite
#3

Por si no estas seguro en que posición numérica esta el nombre de la tabla , SQL_FieldNameToNum se encarga de obtener ese numero.

Se usa mas que nada si se crea una base de datos con su respectiva tabla sin el orden dado por el creador del plugin , porque capaz , el creador pone que se deba leer datos de la columna 1 , y el usuario que instalo el plugin tiene esos datos en la columna 3.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
 



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 08:19.


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