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

Bug in cs_set_user_bpammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JusTGo
Veteran Member
Join Date: Mar 2013
Old 08-27-2018 , 12:30   Bug in cs_set_user_bpammo
Reply With Quote #1

Bug occurs on Linux with latest regamedll / amxx version

Code :

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

public plugin_init()
{
    
register_clcmd"say /ammo_test""cmd_ammo" )
}

public 
cmd_ammoid )
{
    
give_itemid"weapon_ak47" )
    
cs_set_user_bpammo(idCSW_AK4790 )

Error :

Code:
L 08/27/2018 - 14:15:34: [CSTRIKE] Invalid weapon id 28
L 08/27/2018 - 14:15:34: [AMXX] Run time error 10 (plugin "ammo_test.amxx") (native "cs_set_user_bpammo") - debug not enabled!
L 08/27/2018 - 14:15:34: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
__________________

Last edited by JusTGo; 08-27-2018 at 12:31.
JusTGo is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-27-2018 , 12:38   Re: Bug in cs_set_user_bpammo
Reply With Quote #2

Where is the bug? Are you talking about the invalid weapon id error? That's because you didn't check whether the weapon is valid before using.
PHP Code:
#include < amxmodx >
#include < fun >
#include < fakemeta >
#include < cstrike >

public plugin_init( )
{
    
register_clcmd"say /ammo_test""cmd_ammo" )
}

public 
cmd_ammoid )
{
    new 
iEnt give_itemid"weapon_ak47" );

    if( ! 
pev_validiEnt ) )
    return 
PLUGIN_HANDLED;    
    
    
cs_set_user_bpammoidCSW_AK4790 );

__________________
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-27-2018 , 13:03   Re: Bug in cs_set_user_bpammo
Reply With Quote #3

What weapon? He is using CSW_AK47, not an entity index. The bug is not related to give_item.
__________________

Last edited by OciXCrom; 08-27-2018 at 13:03.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-27-2018 , 13:05   Re: Bug in cs_set_user_bpammo
Reply With Quote #4

Quote:
Originally Posted by edon1337 View Post
Where is the bug? Are you talking about the invalid weapon id error? That's because you didn't check whether the weapon is valid before using.
PHP Code:
#include < amxmodx >
#include < fun >
#include < fakemeta >
#include < cstrike >

public plugin_init( )
{
    
register_clcmd"say /ammo_test""cmd_ammo" )
}

public 
cmd_ammoid )
{
    new 
iEnt give_itemid"weapon_ak47" );

    if( ! 
pev_validiEnt ) )
    return 
PLUGIN_HANDLED;    
    
    
cs_set_user_bpammoidCSW_AK4790 );

That's not the case, back pack ammo is not related to the weapon.
https://github.com/alliedmodders/amx...tives.cpp#L755
Probably on regamedll there is an issue retrieving data from WeaponList message, just a wild guess.
__________________
HamletEagle is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viña del Mar, Chile
Old 08-29-2018 , 23:31   Re: Bug in cs_set_user_bpammo
Reply With Quote #5

Maybe there's another addon altering WeaponList values. List all your addons
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 08-30-2018 , 09:28   Re: Bug in cs_set_user_bpammo
Reply With Quote #6

Quote:
Originally Posted by meTaLiCroSS View Post
Maybe there's another addon altering WeaponList values. List all your addons
i m not using other plugins exepect for default amxx plugins which i don't think they use WeaponList.
__________________
JusTGo is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-30-2018 , 09:33   Re: Bug in cs_set_user_bpammo
Reply With Quote #7

Execute these commands in the server console and post outputs:
Code:
version
amxx version
meta version
amxx list
amxx modules
meta list
Are you using ReGameDLL?
__________________

Last edited by klippy; 08-30-2018 at 09:34.
klippy is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 08-30-2018 , 09:52   Re: Bug in cs_set_user_bpammo
Reply With Quote #8

Yes i m using ReGameDll like i said in the first POST + default plugins and modules from amxx :

Code:
version
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.658-dev
Build date: 15:04:52 Aug 11 2018 (1582)
Build from: https://github.com/dreamstalker/rehlds/commit/0ce0af7
Code:
amxx version
AMX Mod X 1.8.3-dev+5192 (http://www.amxmodx.org)
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: Aug 27 2018 06:43:45
Built from: https://github.com/alliedmodders/amxmodx/commit/9e2c76a
Build ID: 5192:9e2c76a
Core mode: JIT+ASM32
Code:
meta version
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
__________________

Last edited by JusTGo; 08-30-2018 at 09:52.
JusTGo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-02-2018 , 05:41   Re: Bug in cs_set_user_bpammo
Reply With Quote #9

I can't reproduce with the latest version of AMXX, metamod-r, ReGameDLL and ReHLDS. Windows or Linux.
You should try first with the latest version and also try with a normal metamod version.
__________________
Arkshine is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 09-02-2018 , 08:38   Re: Bug in cs_set_user_bpammo
Reply With Quote #10

For some reason the bug no longer occurs, i don't remember that i changed any thing, if it happens again i will find the way to reproduce it.
__________________
JusTGo 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 13:03.


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