Raised This Month: $32 Target: $400
 8% 

Solved Run time error 10: native error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 05-27-2023 , 05:50   Run time error 10: native error
Reply With Quote #1

[FUN] Invalid player 1
[AMXX] Displaying debug trace (plugin "tourmaps.amxx", version "0.5")
[AMXX] Run time error 10: native error (native "strip_user_weapons")
[0] tourmaps.sma::strip (line 456)

PHP Code:
public strip (p[1])
{       
    
strip_user_weapons (p[0])    //line 456
    
new team get_user_team (p[0]) - 1
    
    
if (team >= && team <2) {
    
        for (new 
wpi 0wpi g_MapWeaponCount[g_MapsOrder[g_CurrentMapId]][team]; wpi ++) {            
                
            new 
weapon[32]
            if(
g_MapWeapon[g_CurrentMapId][team][wpi] == CSW_SHIELD)
                
format(weapon31"weapon_shield")
            else
                
get_weaponname(g_MapWeapon[g_MapsOrder[g_CurrentMapId]][team][wpi],weapon,31)
            
#if DEBUG == 1
            
server_print ("weapon %s - %d",weapon,g_MapWeapon[g_MapsOrder[g_CurrentMapId]][team][wpi])
#endif
            
            
give_item (p[0],weapon)
            
give_item (p[0],"item_kevlar")
            if (
g_MapWeapon[g_MapsOrder[g_CurrentMapId]][team][wpi] != CSW_KNIFE)
                
cs_set_user_bpammo (p[0],g_MapWeapon[g_MapsOrder[g_CurrentMapId]][team][wpi],g_MapWeaponAmount[g_MapsOrder[g_CurrentMapId]][team][wpi])
                
        }
     }

Any ideas as how to solve it? I thought about checking if the user is alive but I don't know where to put it best.

Last edited by JuanitoAlimana; 05-28-2023 at 21:46.
JuanitoAlimana is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 05-27-2023 , 06:51   Re: Run time error 10: native error
Reply With Quote #2

maybe put it before the error?
lexzor is offline
sb123
Senior Member
Join Date: Jan 2007
Old 05-27-2023 , 14:13   Re: Run time error 10: native error
Reply With Quote #3

if(!is_user_connected(p[0]) return
strip_user_weapons (p[0])
__________________
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-28-2023 , 00:06   Re: Run time error 10: native error
Reply With Quote #4

Something like this is likely better to have fixed elsewhere in the plugin. It would be much easier and quicker if you just posted the whole plugin when you get errors. Are you making modifications to and/or writing this code yourself?

I can't think of any reason for a function like this to use a single cell array as an argument which makes me think there are likely other coding errors.
__________________
fysiks is offline
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 05-28-2023 , 01:34   Re: Run time error 10: native error
Reply With Quote #5

This is the plugin:
https://forums.alliedmods.net/showthread.php?p=185993

I didn't touch absolutely anything. Code is from 2005...

tourmaps.sma
JuanitoAlimana is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-28-2023 , 16:45   Re: Run time error 10: native error
Reply With Quote #6

This same error was posted already by someone back in 2009 and the author responded to it. See posts 111 and 112 here. The author knows the plugin better than I do so I suppose his fix should at least be tested.
__________________

Last edited by fysiks; 05-28-2023 at 16:46.
fysiks is offline
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 05-28-2023 , 21:46   Re: Run time error 10: native error
Reply With Quote #7

Thank you very much, it did solve the problem!
JuanitoAlimana is offline
Reply


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 03:46.


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