[SOLUCIONADO] player_touchweapon (problema)
#1
el log
Cita:L 11/24/2013 - 01:59:54: [CSTRIKE] Player out of range (0)
L 11/24/2013 - 01:59:54: [AMXX] Displaying debug trace (plugin "jbextreme.amxx")
L 11/24/2013 - 01:59:54: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 11/24/2013 - 01:59:54: [AMXX] [0] jbextreme.sma::player_touchweapon (line 788)

el code:
Código PHP:
public player_touchweapon(ident)
{
    if(!
is_user_alive(ent) && cs_get_user_team(ent) == CS_TEAM_T)
    switch(
g_iCurrentDay)
    {
        case 
DAY_HNS:
        {
            if(
cs_get_user_team(ent) == CS_TEAM_T)
            return 
HAM_SUPERCEDE;
        }
    }
    
    static 
model[32], class[32]
    if(
g_BlockWeapons)
    return 
HAM_SUPERCEDE
    
if(is_valid_ent(id) && g_Duel != && is_user_alive(ent) && cs_get_user_team(ent) == CS_TEAM_CT)
    {
        
entity_get_string(idEV_SZ_modelmodelcharsmax(model))
        if(
model[7] == 'w' && model[9] == 'h' && model[10] == 'e' && model[11] == 'g')
        {
            
entity_get_string(idEV_SZ_classname, class, charsmax(class))
            if(
equal(class, "weapon_hegrenade"))
            
remove_entity(id)
            return 
HAM_SUPERCEDE
        
}
        
    }
    return 
HAM_IGNORED

Responder
#2
supongo que el error te lo da el primer cs_get_user_team

no tiene sentido chequear ahí el equipo, porque si un jugador está muerto no va a tocar nada, así que borra ese cs_get_user_team
Código PHP:
if (!is_user_alive(ent))
    return 
HAM_IGNORED
luego debajo del switch le pones

Código PHP:
if (cs_get_user_team(ent) == CS_TEAM_T)
    return 
HAM_IGNORED

más abajo estás chequeando otra vez is_user_alive, bórralo de ahí.
(17/04/2015, 03:36 PM)Neeeeeeeeeel.- escribió: No se va a volver a conectar a internet en toda su puta vida... nadie sube porno a mi foro y vive para contarlo.
Responder
#3
asi?

Código PHP:
public player_touchweapon(ident)
{
    if (!
is_user_alive(ent))
    return 
HAM_IGNORED;
    switch(
g_iCurrentDay)
    { 
        case 
DAY_HNS:
        {
            if(
cs_get_user_team(ent) == CS_TEAM_T)
            return 
HAM_SUPERCEDE;
        }
    }
    if (
cs_get_user_team(ent) == CS_TEAM_T)
    return 
HAM_IGNORED
    static 
model[32], class[32]
    if(
g_BlockWeapons)
    return 
HAM_SUPERCEDE
    
if(is_valid_ent(id) && g_Duel != && cs_get_user_team(ent) == CS_TEAM_CT)
    {
        
entity_get_string(idEV_SZ_modelmodelcharsmax(model))
        if(
model[7] == 'w' && model[9] == 'h' && model[10] == 'e' && model[11] == 'g')
        {
            
entity_get_string(idEV_SZ_classname, class, charsmax(class))
            if(
equal(class, "weapon_hegrenade"))
            
remove_entity(id)
            return 
HAM_SUPERCEDE
        
}
        
    }
    return 
HAM_IGNORED

Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)