AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=7)
-   -   Solved amxmodx vs reapi cssdk/hlsdk_const.inc (https://forums.alliedmods.net/showthread.php?t=311003)

AllMassive 09-29-2018 19:59

amxmodx vs reapi cssdk/hlsdk_const.inc
 
the amxmodx-package contains includes for compiling under the /scripting-folder.
Latest reapi-*.inc's of 'cssdk/hlsdk_const.inc' differ from the recent amxx 1.9.x-inc's.
Inside these 'amxx inc's' was a comment saying: copied parts from reapi.
so i copied the lastest 5229 inc's after copying latest reapi.
but afterwards 'reapi-amxx-plugin' didnt work as designed and i needed to replace 'cssdk/hlsdk_const.inc' with from the reapi-version to let it work again.

JusTGo 09-30-2018 06:14

Re: amxmodx vs reapi cssdk/hlsdk_const.inc
 
AFAIK there is no difference between reapi hlsdk_const.inc and amxmodx hlsdk_const.inc

Arkshine 09-30-2018 07:59

Re: amxmodx vs reapi cssdk/hlsdk_const.inc
 
Before it was the same file (originally they tried to change few things, but they reverted to the original file), after AMXX build 5223, new constants have been added, but no changes for the existing constants.

@AllMassive what do you mean by "'reapi-amxx-plugin' didn't work as designed"? Are you saying it doesn't compile?

AllMassive 09-30-2018 16:10

Re: amxmodx vs reapi cssdk/hlsdk_const.inc
 
It did compile, but didnt work correctly afterwards.
The plugin was
Code:

[ReAPI] AdminFreeLook", "1.0"
After compiling with the mentioned newest amxx-inc's the admins were not able to watch both teams when 'mp_forcecamera 2' is enabled. Switching back to the ones from reapi and recompiling it worked again.

Arkshine 09-30-2018 16:14

Re: amxmodx vs reapi cssdk/hlsdk_const.inc
 
I'm not sure how it's possible. It seems totally unrelated. The amxx file contains only new constants: https://github.com/alliedmodders/amx...17df655059a338

Can you post this plugin?

AllMassive 09-30-2018 18:23

Re: amxmodx vs reapi cssdk/hlsdk_const.inc
 
here it is:

Code:

#include <amxmodx>
#include <reapi>

const ACCESS_FLAG = ADMIN_BAN;

public plugin_init()
{
        register_plugin("[ReAPI] AdminFreeLook", "1.0", "ReHLDS Team");

        if(!is_regamedll()) {
                set_fail_state("ReGameDLL is not available");
                return;
        }

        RegisterHookChain(RG_GetForceCamera, "GetForceCamera");
        RegisterHookChain(RG_CBasePlayer_Observer_IsValidTarget, "Observer_IsValidTarget");
}

public GetForceCamera(const index)
{
        if (!shouldRunCode())
                return HC_CONTINUE;
       
        if (canFreeLook(index)) {
                SetHookChainReturn(ATYPE_INTEGER, 0);
                return HC_SUPERCEDE;
        }

        return HC_CONTINUE;
}

public Observer_IsValidTarget(const this, const iPlayerIndex, bool:bSameTeam)
{
        if (shouldRunCode())
                return HC_CONTINUE;

        if (!is_user_connected(iPlayerIndex))
                return HC_CONTINUE;

        if (iPlayerIndex == this || get_entvar(iPlayerIndex, var_iuser1) > 0 || (get_entvar(iPlayerIndex, var_effects) & EF_NODRAW) || get_member(iPlayerIndex, m_iTeam) == TEAM_UNASSIGNED)
                return HC_CONTINUE;

        // Don't spec observers or players who haven't picked a class yet
        if (bSameTeam && get_member(iPlayerIndex, m_iTeam) != get_member(this, m_iTeam))
                return HC_CONTINUE;

        if (canFreeLook(iPlayerIndex)) {
                SetHookChainReturn(ATYPE_INTEGER, iPlayerIndex);
                return HC_SUPERCEDE;
        }

        return HC_CONTINUE;
}

stock bool:canFreeLook(const index) {
        return bool:(get_user_flags(index) & ACCESS_FLAG);
}

stock bool:shouldRunCode()
{
        return bool:(Float:get_member_game(m_flFadeToBlackValue) <= 0.0
                && Float:get_member_game(m_flForceCameraValue) > 0.0
                && Float:get_member_game(m_flForceChaseCamValue) > 0.0);
}


Arkshine 09-30-2018 18:30

Re: amxmodx vs reapi cssdk/hlsdk_const.inc
 
As you can see yourself in the link, not a single new constants are used in the plugin, nor existing constants are modified.

The only existing you"re using is EF_NODRAW, and you can see the value is the same.

Unless I'm missing something, this can't be the reason.

AllMassive 10-03-2018 20:46

Re: amxmodx vs reapi cssdk/hlsdk_const.inc
 
Strange - so it didnt update the *.inc before :/

sry....


All times are GMT -4. The time now is 15:23.

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