alliedmodders / amxmodx

AMX Mod X - Half-Life 1 Scripting and Administration
http://www.amxmodx.org/
497 stars 201 forks source link

gamerules gamedata for ReGameDLL_CS imcompatible? #825

Open SmileYzn opened 4 years ago

SmileYzn commented 4 years ago

Help us help you

Environment

Description

Im trying to reset freezetime or round time on the fly, in original HLDS the code works fine. m_fRoundCount do not exists or is not correct for ReGameDLL_CS. Sorry for being a noob, but is not the case to add or update current gamedata for regamedll_cs?

Problematic Code (or Steps to Reproduce)

stock SetRoundTime(iTime)
{
    static iMsgRoundTime;

    if(iMsgRoundTime || (iMsgRoundTime = get_user_msgid("RoundTime")))
    {
        set_gamerules_int("CHalfLifeMultiplay","m_iRoundTimeSecs",iTime);
        set_gamerules_float("CHalfLifeMultiplay","m_fRoundCount",get_gametime());

        message_begin(MSG_ALL,iMsgRoundTime);
        write_short(iTime);
        message_end();
    }
}  

The main problem is that m_fRoundCount offsets do not exist on ReGameDLL_CS. So when i use this code works fine on original but not on ReGameDLL_CS (The roundtimer goes crazy and players are respawned again).

Any idea if this is a real "BUG" or not?

etojuice commented 4 years ago

Not a bug, ReGameDLL_CS has custom gamerules data. https://github.com/s1lentq/ReGameDLL_CS/blob/27b2a8c8c950540a2dd9fde32da6f7f13e842eaa/regamedll/dlls/gamerules.h#L335-L337 You have to use reapi to manipulate gamerules because of that.

SmileYzn commented 4 years ago

So, there is the question. I know that amxmodx supports ReGameDLL_CS, but why not implement these offsets on current game data to?

voed commented 4 years ago

So, there is the question. I know that amxmodx supports ReGameDLL_CS, but why not implement these offsets on current game data to?

because you can use reapi, there's no point to duplicate it

etojuice commented 4 years ago

So, there is the question. I know that amxmodx supports ReGameDLL_CS, but why not implement these offsets on current game data to?

I'm not sure. I think it's because game name is the same (cstrike)

xLeviNx commented 4 years ago

So, there is the question. I know that amxmodx supports ReGameDLL_CS, but why not implement these offsets on current game data to?

I'm not sure. I think it's because game name is the same (cstrike)

what?

As voed said, you can use reapi

SmileYzn commented 4 years ago

Soo i basically can't use gamedata from fakemeta in rehlds? A bit strange to me. Since plugins need to maintain compatibility with these two servers to be approved in amxx forums.

Let's see what other users think :happy:

WaLkZa commented 1 year ago

@SmileYzn https://github.com/s1lentq/ReGameDLL_CS/blob/eb91f9280d34deb47e54ee7d28d69de30ee31339/regamedll/dlls/gamerules.h#L701