AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] [CSTRIKE] Non-player entity (https://forums.alliedmods.net/showthread.php?t=241611)

plazma 06-06-2014 11:39

[SOLVED] [CSTRIKE] Non-player entity
 
My mod is ZPA.

Here is error in logs ??

Code:

[CSTRIKE] Non-player entity -1 out of range
[AMXX] Displaying debug trace (plugin "xxx.amxx")
[AMXX] Run time error 10: native error (native "cs_set_weapon_ammo")
[AMXX]    [0] xxx.sma::fm_cs_get_current_weapon_ent (line 12030)
[AMXX]    [1] xxx.sma::message_cur_weapon (line 5038)

PHP Code:

// Max Clip for weapons
new const MAXCLIP[] = { -113, -110, -17, -13030, -13020253035251220,
            
10301008303020, -173030, -150 

PHP Code:

    // Message hooks
    
register_message(g_msgCurWeapon"message_cur_weapon"

PHP Code:

/*================================================================================
 [Message Hooks]
=================================================================================*/

// 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_survivor[msg_entity] ? get_pcvar_num(cvar_survinfammo) <= get_pcvar_num(cvar_infammo) <= && g_sniper[msg_entity] ? get_pcvar_num(cvar_sniperinfammo) <= get_pcvar_num(cvar_infammo) <= 1)
        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])
        
        
// 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)
{
    return 
get_pdata_cbase(idOFFSET_ACTIVE_ITEMOFFSET_LINUX);



mottzi 06-06-2014 16:34

Re: [Help] [CSTRIKE] Non-player entity
 
check if 1 <= msg_entity <= get_maxplayers().

where is
fm_cs_get_current_weapon_ent()
from? Can we see this function please.

plazma 06-08-2014 06:35

Re: [Help] [CSTRIKE] Non-player entity
 
This ?

PHP Code:

if( (<= msg_entity <= g_iMaxPlayers) && is_user_connected(msg_entity)) 


plazma 08-26-2014 06:31

Re: [Help] [CSTRIKE] Non-player entity
 
help please my server is down every 2-3 day for this error...

RateX 08-26-2014 07:15

Re: [Help] [CSTRIKE] Non-player entity
 
Don't double post https://forums.alliedmods.net/showthread.php?t=246996

meTaLiCroSS 08-26-2014 20:57

Re: [Help] [CSTRIKE] Non-player entity
 
Code is right, this is an issue related to versions.

Show outputs of

rcon version
rcon amxx version
rcon meta list
rcon meta version

And the values of
OFFSET_ACTIVE_ITEM
OFFSET_LINUX


IT IS REQUIRED :mrgreen:

plazma 08-27-2014 14:28

Re: [Help] [CSTRIKE] Non-player entity
 
SLOVED


All times are GMT -4. The time now is 09:48.

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