Raised This Month: $12 Target: $400
 3% 

Solved amxmodx vs reapi cssdk/hlsdk_const.inc


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AllMassive
Senior Member
Join Date: Sep 2004
Location: /dev/urandom
Old 09-29-2018 , 19:59   amxmodx vs reapi cssdk/hlsdk_const.inc
Reply With Quote #1

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.

Last edited by AllMassive; 01-27-2020 at 20:55. Reason: typo
AllMassive is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 09-30-2018 , 06:14   Re: amxmodx vs reapi cssdk/hlsdk_const.inc
Reply With Quote #2

AFAIK there is no difference between reapi hlsdk_const.inc and amxmodx hlsdk_const.inc
__________________

Last edited by JusTGo; 09-30-2018 at 06:15.
JusTGo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-30-2018 , 07:59   Re: amxmodx vs reapi cssdk/hlsdk_const.inc
Reply With Quote #3

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?
__________________

Last edited by Arkshine; 09-30-2018 at 08:01.
Arkshine is offline
AllMassive
Senior Member
Join Date: Sep 2004
Location: /dev/urandom
Old 09-30-2018 , 16:10   Re: amxmodx vs reapi cssdk/hlsdk_const.inc
Reply With Quote #4

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.

Last edited by AllMassive; 09-30-2018 at 16:12. Reason: typo
AllMassive is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-30-2018 , 16:14   Re: amxmodx vs reapi cssdk/hlsdk_const.inc
Reply With Quote #5

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?
__________________
Arkshine is offline
AllMassive
Senior Member
Join Date: Sep 2004
Location: /dev/urandom
Old 09-30-2018 , 18:23   Re: amxmodx vs reapi cssdk/hlsdk_const.inc
Reply With Quote #6

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);
}
AllMassive is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-30-2018 , 18:30   Re: amxmodx vs reapi cssdk/hlsdk_const.inc
Reply With Quote #7

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.
__________________
Arkshine is offline
AllMassive
Senior Member
Join Date: Sep 2004
Location: /dev/urandom
Old 10-03-2018 , 20:46   Re: amxmodx vs reapi cssdk/hlsdk_const.inc
Reply With Quote #8

Strange - so it didnt update the *.inc before :/

sry....
AllMassive 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 15:27.


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