From the beginning I want to state that I know about the existence of VEN's plugin and tutorial, but it uses an inefficient method with fakeplayers. This time I will try to show you how to do that directly, by changing some game offsets.
I don't have time to write an api for that, anyway if someone want to do it based on the informations from that topic I'll be glad.
The tutorial is for all coders, although it can confuse beginners or make no sense, but I'll do my best to explain everyting.
My ideea is that we can alter the offset that are responsible for round objectives. After that, all we have to do is to call CHalfLifeMultiplay::CheckWinConditions() to make the game take our changes into account.
m_bBombDefused // the bomb was defused ?
m_bTargetBombed //the target has been bombed ?
If m_bBombDefused is true it means that CT won the round, if m_bTargetBombed is true it means that T won it.
Rember that in order to hook functions from CHalfLifeMultiplay you need to firstly hook InstallGameRules function.
1. Hook InstallGameRules
Code:
new g_pGameRules
public plugin_precache(){
OrpheuRegisterHook(OrpheuGetFunction("InstallGameRules"), "OnInstallGameRules", OrpheuHookPost)}public OrpheuHookReturn:OnInstallGameRules(){//Get game rules object because CHalfLifeMultiplay functions need to be retrieved from an object
g_pGameRules = OrpheuGetReturn()}
new OrpheuFunction: CGameRulesCheckWinConditions
public plugin_init(){
CGameRulesCheckWinConditionsHook = OrpheuGetFunctionFromObject(g_pGameRules, "CheckWinConditions", "CGameRules")}
Also CheckWinConditions is a virtual function, no need to create a signature, more reliable to use the index.
At the end, explaining how works the game, why not, but if you don't fully understand what you're saying, there is no point, and will confuse more, which is the case here. So you better rewrite a proper tutorial with keeping in mind a plugin already exists for that.
Sorry for off-topic but this is sort of related with. Just by curiosity, is it possible to block game commecing without orpheu? Would the fake clients block it? Thanks.
Sorry for off-topic but this is sort of related with. Just by curiosity, is it possible to block game commecing without orpheu? Would the fake clients block it? Thanks.
Even if possible why would you use such stupid way with fakeplayers when you have a direct way with orpheu ?
The most important question is: Why should i run orpheu in a 24/7 server? Orpheu is an amazing module, indeed. But i will not lose my time with signatures. Because sometimes it might require updates. And i won't be with my server closed till update it. Orpheu might be beautiful, but it isn't something to use in a 24/7 server.
And a fake player wouldn't hurt in a 32 slots server if the only usage of the bot is blocking game commecing.
Signature is not going to change, unless steam decide to do a major update (upgrading toolset to compile, it was a special opportunity because of OSX, new compiler has obviously changed the output) or the code of the concerned function is changed. Both are now very unlikely to happen again. And getting signature is very very easy with IDA. It takes few seconds. Your argument doesn't make much sense.
__________________
Last edited by Arkshine; 12-19-2014 at 09:16.
Reason: s
Still no sense to use it for only block game commecing. And i don't trust steam, they did an update basickly without tell us to be ready. I won't take that risk.