Raised This Month: $ Target: $400
 0% 

[SOLVED] [CSTRIKE] Non-player entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
plazma
Senior Member
Join Date: Oct 2013
Old 06-06-2014 , 11:39   [SOLVED] [CSTRIKE] Non-player entity
Reply With Quote #1

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);

__________________
Free Palestine ♥

Last edited by plazma; 08-27-2014 at 14:28.
plazma is offline
Old 06-06-2014, 16:24
plazma
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 06-06-2014 , 16:34   Re: [Help] [CSTRIKE] Non-player entity
Reply With Quote #2

check if 1 <= msg_entity <= get_maxplayers().

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

Last edited by mottzi; 06-06-2014 at 16:36.
mottzi is offline
Send a message via MSN to mottzi
plazma
Senior Member
Join Date: Oct 2013
Old 06-08-2014 , 06:35   Re: [Help] [CSTRIKE] Non-player entity
Reply With Quote #3

This ?

PHP Code:
if( (<= msg_entity <= g_iMaxPlayers) && is_user_connected(msg_entity)) 
__________________
Free Palestine ♥
plazma is offline
plazma
Senior Member
Join Date: Oct 2013
Old 08-26-2014 , 06:31   Re: [Help] [CSTRIKE] Non-player entity
Reply With Quote #4

help please my server is down every 2-3 day for this error...
__________________
Free Palestine ♥
plazma is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 08-26-2014 , 07:15   Re: [Help] [CSTRIKE] Non-player entity
Reply With Quote #5

Don't double post https://forums.alliedmods.net/showthread.php?t=246996
RateX is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 08-26-2014 , 20:57   Re: [Help] [CSTRIKE] Non-player entity
Reply With Quote #6

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
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
plazma
Senior Member
Join Date: Oct 2013
Old 08-27-2014 , 14:28   Re: [Help] [CSTRIKE] Non-player entity
Reply With Quote #7

SLOVED
__________________
Free Palestine ♥
plazma is offline
Reply



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 09:48.


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