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

Weird Bug in Deathrun


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 06-17-2018 , 18:02   Weird Bug in Deathrun
Reply With Quote #1

So, i've been using the same Deathrun Manager for about some time already and i've never had any problems or errors with it.

But, recently i upgraded my server from AMX 1.8.3 +dev-5151 to 1.8.3 +dev-5154 and i started receiving an strange error and random crashes with no pattern (the second applies to every single map)

I'm using DeathrunManager by xPaw.

PHP Code:
public GiveUsp( const id ) {
    if( 
is_user_aliveid ) ) 
    {
        
give_itemid"weapon_usp" );
        
cs_set_user_bpammoidCSW_USP100 ); // This is the line that creates problems
    
}

PHP Code:
L 06/17/2018 10:24:52: [AMXXRun time error 10 (plugin "DeathrunManager.amxx") (native "cs_set_user_bpammo") - debug not enabled!
L 06/17/2018 10:24:52: [AMXXTo enable debug modeadd "debug" after the plugin name in plugins.ini (without quotes).
L 06/17/2018 10:25:04: [CSTRIKEInvalid weapon id 16 
This is strange, in cstrike_const.inc ID 16 is CSW_USP, but it says it is invalid?

Metamod
Code:
Metamod v1.21p37  2013/05/30 (5:13)
by Will Day
   http://www.metamod.org/
 Patch: Metamod-P (mm-p) v37
 by Jussi Kivilinna
    http://metamod-p.sourceforge.net/
compiled: May 30 2013, 11:41:16 EET (optimized)
Code:
AMX Mod X 1.8.3-dev+5154
Authors: 
         David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko, Felix "SniperBeamer" Geyer
         Jonny "Got His Gun" Bergstrom, Lukasz "SidLuke" Wlasinski
         Christian "Basic-Master" Hammacher, Borja "faluco" Ferrer
         Scott "DS" Ehlert
Compiled: Mar  9 2018, 10:33:52
URL:http://www.amxmodx.org/
Core mode: JIT
Meta list
Code:
Currently loaded plugins:
      description      stat pend  file              vers      src   load  unlod
 [ 1] AMX Mod X        RUN   -    amxmodx_mm_i386.  v1.8.3-d  ini   Start ANY  
 [ 2] Engine           RUN   -    engine_amxx_i386  v1.8.3-d  pl1   ANY   ANY  
 [ 3] FakeMeta         RUN   -    fakemeta_amxx_i36  v1.8.3-d  pl1   ANY   ANY
 [ 4] Fun              RUN   -    fun_amxx_i386  v1.8.3-d  pl1   ANY   ANY
 [ 5] CStrike          RUN   -    cstrike_amxx_i38  v1.8.3-d  pl1   ANY   ANY  
 [ 6] Ham Sandwich     RUN   -    hamsandwich_amxx  v1.8.3-d  pl1   ANY   ANY  
 [ 7] GeoIP            RUN   -    geoip_amxx_i386.  v1.8.3-d  pl1   ANY   ANY
I didn't enable debug because this is just weird, i've never had a single error with it before. I must say that i did recompile every plugin (updated client_disconnect to client_disconnected and so on).

There is only one crash that has a pattern, and that is when the DR is about to pick the first terrorist (the round ends and it crashes right after, before even starting)

So, i'm here because i don't know if there is a bug with this version of AMXX or is there something else causing this, any ideas?
__________________

Last edited by marcelowzd; 06-18-2018 at 10:58. Reason: Added amx version
marcelowzd is offline
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 06-18-2018 , 01:30   Re: Weird Bug in Deathrun
Reply With Quote #2

Post full code.
__________________
CrAzY MaN is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-18-2018 , 01:38   Re: Weird Bug in Deathrun
Reply With Quote #3

Either way this should never happen:

Code:
L 06/17/2018 - 10:25:04: [CSTRIKE] Invalid weapon id 16
As weapon id 16 is in fact, valid, that much we know for sure hmm

Also the reason for the crash when picking a terrorist could be an infinity loop, there's a while loop that could potentially get into one, also the whole function itself is looped under certain conditions, I just have no idea why it would start behaving like that since the update ( Unless you changed something ).

This is just a guess, but hear me out, since we already saw a weird problem with you cstrike module,im gonna guess that it has something to do with it. Because there are several cstrike functions in EventRandromize() and if those return a wrong value every time, it would cause an infinite loop. Just shooting in the dark.

But yes, please post the full code.
__________________
stuff

Last edited by maqi; 06-18-2018 at 01:54.
maqi is offline
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 06-18-2018 , 01:51   Re: Weird Bug in Deathrun
Reply With Quote #4

Try
Code:
public GiveUsp( id )
All looks fine in that code.

If that doesn't help, enable debug mode and post full code.
__________________
CrAzY MaN is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-18-2018 , 04:34   Re: Weird Bug in Deathrun
Reply With Quote #5

Simply use amx latest stable version and its 182.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-18-2018 at 04:34.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-18-2018 , 07:57   Re: Weird Bug in Deathrun
Reply With Quote #6

Quote:
Originally Posted by Natsheh View Post
Simply use amx latest stable version and its 182.
Um, no.

I'm too lazy to download 5154 right now, but you can test this simple code and see if the same error pops up:

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

public plugin_init()
{
    
register_plugin("PluginName""1.0""OciXCrom")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)
}

public 
OnPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        
give_item(id"weapon_usp")
        
cs_set_user_bpammo(idCSW_USP100)
    }

If it does and you're sure you didn't modify any of your default AMXX files, then it's a bug with the dev version that must be fixed immediately.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 06-18-2018 , 10:43   Re: Weird Bug in Deathrun
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
Um, no.

I'm too lazy to download 5154 right now, but you can test this simple code and see if the same error pops up:

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

public plugin_init()
{
    
register_plugin("PluginName""1.0""OciXCrom")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)
}

public 
OnPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        
give_item(id"weapon_usp")
        
cs_set_user_bpammo(idCSW_USP100)
    }

If it does and you're sure you didn't modify any of your default AMXX files, then it's a bug with the dev version that must be fixed immediately.
Code:
L 06/18/2018 - 11:30:50: Start of error session.
L 06/18/2018 - 11:30:50: Info (map "as_oilrig") (file "addons/amxmodx/logs/error_20180618.log")
L 06/18/2018 - 11:30:50: [CSTRIKE] Invalid weapon id 16
L 06/18/2018 - 11:30:50: [AMXX] Run time error 10 (plugin "test.amxx") (native "cs_set_user_bpammo") - debug not enabled!
L 06/18/2018 - 11:30:50: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/18/2018 - 11:30:50: [CSTRIKE] Invalid weapon id 16
L 06/18/2018 - 11:30:50: [AMXX] Run time error 10 (plugin "test.amxx") (native "cs_set_user_bpammo") - debug not enabled!
L 06/18/2018 - 11:30:50: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
Tested in a map where there wasn't any other plugin besides this one and the same happens.

For people requesting full code, it is just the default DeathrunManager. The only thing i replaced was the deprecated functions, like client_disconnect to client_disconnected, but when i was using 1.8.3 5151 they were already there.

PHP Code:
public plugin_init( )
{
       
RegisterHamHam_Spawn,      "player""FwdHamPlayerSpawn");
}

public 
FwdHamPlayerSpawnid ) {
    if( !
g_bEnabled || !is_user_aliveid ) )
        return 
HAM_IGNORED;
    
    if( 
get_pcvar_numg_pBlockRadio ) ) // thanks to ConnorMcLeod for this good way :)
        
set_pdata_intid192);
    
#if defined FAKE_PLAYER
    
if( g_iFakeplayer == id ) {
        
set_pevidpev_frags, -1000.0 );
        
cs_set_user_deathsid, -1000 );
        
        
set_pevidpev_effectspevidpev_effects ) | EF_NODRAW );
        
set_pevidpev_solidSOLID_NOT );
        
entity_set_originidFloat:{ 999999.0999999.0999999.0 } );
        
dllfuncDLLFunc_Thinkid );
    } else {
#endif
        
new CsTeams:iTeam cs_get_user_teamid );
        
        
// An small delay for message
        
if( get_pcvar_numg_pLifeSystem ) != && iTeam == CS_TEAM_CT )
            
set_task0.8"Showlifes"id );
        
        
strip_user_weaponsid );
        
give_itemid"weapon_knife" );
        
        
set_pdata_intid116); // Pickup fix by ConnorMcLeod
        
        
if( g_bGamerFun && iTeam == CS_TEAM_CT )
            
give_itemid"weapon_smokegrenade" );
        
        if( 
get_pcvar_numg_pGiveUsp ) && iTeam == CS_TEAM_CT && !g_bHauntedHouse )
            
set_task1.0"GiveUsp"id );
    
        
set_user_gravity(id1.0);
        
#if defined FAKE_PLAYER
    
}
#endif
    
    
return HAM_IGNORED;

I'll download again the cstrike module just to be sure.

EDIT - Added debug, but it doesn't say anything that changes the situation

Code:
L 06/18/2018 - 11:49:08: [CSTRIKE] Invalid weapon id 16
L 06/18/2018 - 11:49:08: [AMXX] Displaying debug trace (plugin "DeathrunManager.amxx", version "3.0.3")
L 06/18/2018 - 11:49:08: [AMXX] Run time error 10: native error (native "cs_set_user_bpammo")
L 06/18/2018 - 11:49:08: [AMXX]    [0] DR_Core.sma::GiveUsp (line 678)
__________________

Last edited by marcelowzd; 06-18-2018 at 11:00.
marcelowzd is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 06-18-2018 , 11:05   Re: Weird Bug in Deathrun
Reply With Quote #8

Do you have a plugin blocking the "WeaponList" message? This is happening because the module can't retrieve weapon information that it collects from that user message.
__________________
klippy is offline
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 06-18-2018 , 11:11   Re: Weird Bug in Deathrun
Reply With Quote #9

Quote:
Originally Posted by KliPPy View Post
Do you have a plugin blocking the "WeaponList" message? This is happening because the module can't retrieve weapon information that it collects from that user message.
I tested in as_oilrig with the example Ocixcrom gave me and the error also appeared there.

Plugins.ini (that's the only thing in as_oilrig, there isn't a plugins-as.ini or something)
Code:
; Server Bans - Advanced Bans required at the top to run properly
AdvancedBans.amxx   	; Bans avançados

; Admin Base - Always one has to be activated
admin.amxx		; admin base (required for any admin-related)
;admin_sql.amxx		; admin base - SQL version (comment admin.amxx)

; Basic
admincmd.amxx		; basic admin console commands
adminhelp.amxx		; help command for admin console commands
adminslots.amxx		; slot reservation
multilingual.amxx	; Multi-Lingual management

; Menus
menufront.amxx		; front-end for admin menus
cmdmenu.amxx		; command menu (speech, settings)
plmenu.amxx		; players menu (kick, ban, client cmds.)
telemenu.amxx		; teleport menu (Fun Module required!)
mapsmenu.amxx		; maps menu (vote, changelevel)
pluginmenu.amxx		; Menus for commands/cvars organized by plugin

; Chat / Messages
adminchat.amxx		; console chat commands
antiflood.amxx		; prevent clients from chat-flooding the server
scrollmsg.amxx		; displays a scrolling message
imessage.amxx		; displays information messages
adminvote.amxx		; vote commands

; Map related
;nextmap.amxx		; displays next map in mapcycle
;mapchooser.amxx	; allows to vote for next map
timeleft.amxx		; displays time left on map

; Configuration
pausecfg.amxx		; allows to pause and unpause some plugins
statscfg.amxx		; allows to manage stats plugins via menu and commands

; Counter-Strike
;restmenu.amxx		; restrict weapons menu
;statsx.amxx		; stats on death or round end (CSX Module required!)
;miscstats.amxx		; bunch of events announcement for Counter-Strike
;stats_logging.amxx	; weapons stats logging (CSX Module required!)

; Custom - Add 3rd party plugins here
EntityRemover.amxx
__________________
marcelowzd is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-18-2018 , 12:06   Re: Weird Bug in Deathrun
Reply With Quote #10

Test in amx v182 and see if the error still occur, give feedback.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 19:08.


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