Raised This Month: $ Target: $400
 0% 

Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AwesomeMan
Member
Join Date: Jun 2013
Old 08-11-2013 , 15:38   Error
Reply With Quote #1

L 08/11/2013 - 20:292: [CSTRIKE] Non-player entity -1 out of range
L 08/11/2013 - 20:292: [AMXX] Displaying debug trace (plugin test.amxx")
L 08/11/2013 - 20:292: [AMXX] Run time error 10: native error (native "cs_set_weapon_ammo")
L 08/11/2013 - 20:292: [AMXX] [0] test.sma::knife (line 251)

This is error i get
This is the function:
PHP Code:
public knife(id)
{
    if(
is_user_alive(id)) {
        new 
clipammo;
        new 
usersweapon get_user_weapon idclipammo );
        if ( 
usersweapon == CSW_C4 ) {
            new 
cclipaammo
            get_user_ammo
(idCSW_DEAGLEcclipaammo)
            if(
is_user_alive(id)) {
                
strip_user_weapons(id)
                
give_item(id,"weapon_knife")
                
cs_set_weapon_ammo(give_item(id"weapon_deagle"), cclip)
            }
        }
    }

Activated by this:
PHP Code:
register_event "CurWeapon""knife""b" ); 
And line 251 is this:
PHP Code:
cs_set_weapon_ammo(give_item(id"weapon_deagle"), cclip
It just fills up my error log file. How can I fix it?
AwesomeMan is offline
Cheezpuff
BANNED
Join Date: Oct 2012
Location: City of the Dead
Old 08-11-2013 , 16:01   Re: Error
Reply With Quote #2

PHP Code:
public knife(id

    if(
is_user_alive(id)) { 
        new 
clipammo
        new 
usersweapon get_user_weapon idclipammo ); 
        if ( 
usersweapon == CSW_C4 ) { 
            new 
cclipaammo 
            get_user_ammo
(idCSW_DEAGLEcclipaammo
            if(
is_user_alive(id)) { 
                
strip_user_weapons(id
                
give_item(id,"weapon_knife"
                
cs_set_weapon_ammo(give_item(id"weapon_deagle"), cclip
            } 
        } 
    } 


PHP Code:
public knife(id)
{
    if(
is_user_alive(id)) {
        new 
clipammo;
        new 
usersweapon get_user_weapon idclipammo );
        if ( 
usersweapon == CSW_C4 ) {
            new 
cclipaammo
            get_user_ammo
(idCSW_DEAGLEcclipaammo)
            if(
is_user_alive(id)) {
                
fm_strip_user_weaponsid )
                
fm_give_itemid"weapon_knife" )
                
cs_set_user_ammoid,"weapon_deagle"), cclip)    
            }
        }
    }

i think, and try to remove cclip) from weapon_deagle then complie
Cheezpuff is offline
Send a message via Skype™ to Cheezpuff
AwesomeMan
Member
Join Date: Jun 2013
Old 08-11-2013 , 18:20   Re: Error
Reply With Quote #3

Works great so far. Cheers mate!
AwesomeMan 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 15:47.


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