Raised This Month: $23 Target: $400
 5% 

argbrek and strbreak


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lord94
Junior Member
Join Date: Aug 2018
Old 05-09-2020 , 13:23   argbrek and strbreak
Reply With Quote #1

o.k so i decided to upgrade to amxx v1.10 and so i did and started to compile plugins.

came accross with a problem in a certain plugin. GHW Model Replacement.

It showed few warnings, strbreak, to be replaced with argbreak. I opened the source, edited and complied without any warnings.

But in game i have different skins for different teams and after upgrade the t skins were replaced by cts' skins. (worked fine before upgrade)

Edited source for upgrade:
Spoiler
Lord94 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-09-2020 , 15:04   Re: argbrek and strbreak
Reply With Quote #2

If it's a deprecation warning, I wouldn't recommend changing it, it should work exactly like it did before. If you start changing code without fully understanding the differences, it's possible to break the code like you just found out.

Change it back to the original and see if it works.
__________________
fysiks is offline
Lord94
Junior Member
Join Date: Aug 2018
Old 05-10-2020 , 11:25   Re: argbrek and strbreak
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
If it's a deprecation warning, I wouldn't recommend changing it, it should work exactly like it did before. If you start changing code without fully understanding the differences, it's possible to break the code like you just found out.

Change it back to the original and see if it works.
Did as you told me, the problem remains the same.
Looks like i'm gonna stick to same skins for both teams.

Thanks anyways.
Lord94 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-12-2020 , 19:19   Re: argbrek and strbreak
Reply With Quote #4

Show your changes, you might be using argbreak() the wrong way.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-12-2020 , 22:35   Re: argbrek and strbreak
Reply With Quote #5

Quote:
Originally Posted by Lord94 View Post
Did as you told me, the problem remains the same.
Looks like i'm gonna stick to same skins for both teams.

Thanks anyways.
Then either the plugin didn't work to begin with or there is a bug in AMX Mod X 1.10
__________________
fysiks is offline
Lord94
Junior Member
Join Date: Aug 2018
Old 05-13-2020 , 08:17   Re: argbrek and strbreak
Reply With Quote #6

Quote:
Originally Posted by Napoleon_be View Post
Show your changes, you might be using argbreak() the wrong way.
This two lines showed warnings, in top of public load_models function(the php i attached in the first post)

PHP Code:
argbreak(read,left,47,right,47
PHP Code:
argbreak(right,right,47,right2,31
i simply replaced strbreak with argbreak nothing else.

Quote:
Originally Posted by fysiks View Post
Then either the plugin didn't work to begin with or there is a bug in AMX Mod X 1.10
It was working just fine in 1.8.2, also i thought that 1.10 may be bugged so i changed to 1.9.0, but still the same.

EDIT: Maybe the argbreak is fine, but i read somewhere in the forum that get_user_team is not fixed? in this plugin in curweapon event hook there is a get_user_team, is it maybe bcs of that?
PHP Code:
public Changeweapon_Hook(id)
{
    if( ! 
is_user_alive(id) )
    {
        return 
PLUGIN_CONTINUE
    
}
    static 
model[32], iteam

    team 
get_user_team(id)

    
pev(id,pev_viewmodel2,model,31)
    for(
i=0;i<v_modelsnum;i++)
    {
        if(
equali(model,old_v_models[i]))
        {
            if(
v_models_team[i]==team || !v_models_team[i])
            {
                
set_pev(id,pev_viewmodel2,new_v_models[i])
                break;
            }
        }
    }

    
pev(id,pev_weaponmodel2,model,31)
    for(
i=0;i<p_modelsnum;i++)
    {
        if(
equali(model,old_p_models[i]))
        {
            if(
p_models_team[i]==team || !p_models_team[i])
            {
                
set_pev(id,pev_weaponmodel2,new_p_models[i])
                break;
            }
        }
    }
    return 
PLUGIN_CONTINUE


Last edited by Lord94; 05-13-2020 at 09:15.
Lord94 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 13:24.


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