AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   argbrek and strbreak (https://forums.alliedmods.net/showthread.php?t=324207)

Lord94 05-09-2020 13:23

argbrek and strbreak
 
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

fysiks 05-09-2020 15:04

Re: argbrek and strbreak
 
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.

Lord94 05-10-2020 11:25

Re: argbrek and strbreak
 
Quote:

Originally Posted by fysiks (Post 2699104)
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.

Napoleon_be 05-12-2020 19:19

Re: argbrek and strbreak
 
Show your changes, you might be using argbreak() the wrong way.

fysiks 05-12-2020 22:35

Re: argbrek and strbreak
 
Quote:

Originally Posted by Lord94 (Post 2699267)
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

Lord94 05-13-2020 08:17

Re: argbrek and strbreak
 
Quote:

Originally Posted by Napoleon_be (Post 2699825)
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 (Post 2699844)
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




All times are GMT -4. The time now is 17:05.

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