Raised This Month: $ Target: $400
 0% 

[SOLVED] [CSTRIKE] Non-player entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


Thread Tools
Display Modes

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