AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [DEV] Gamerules Hax (https://forums.alliedmods.net/showthread.php?t=183257)

Dr!fter 04-19-2012 16:51

[DEV] Gamerules Hax
 
3 Attachment(s)
This is a very basic plugin that adds a native to get the pointer address for g_pGameRules. This allows you to load/store things to an arbitrary offset from that address.

Example usage (Thanks to GoD-Tony for finding it)
Changing score in CS:S

Spoiler


Currently this only supports DOD:S, GarrysMod (whatever version runs on OB engine) CS:S, TF2, and HL2MP. Other games can be added upon request. Just let me know which game.

Install:
gameruleshax.games.txt -> addons/sourcemod/gamedata
gameruleshax.smx -> addons/sourcemod/plugins
For compiling a seperate plugin gameruleshax.inc -> addons/sourcemod/scripting/include

TnTSCS 04-19-2012 16:56

Re: [DEV] Gamerules Hax
 
w00t, nice :)

Thank you for this

RedSword 04-19-2012 22:52

Re: [DEV] Gamerules Hax
 
Wait; does this change the REAL score ? is it a realy single-use-needed-SetTeamScore ? i.e. its 1-0 and you use that function to say it is 1337-0. On next point; will it be 1338-0 or 2-0 ?

Dr!fter 04-20-2012 00:29

Re: [DEV] Gamerules Hax
 
Quote:

Originally Posted by RedSword (Post 1692721)
Wait; does this change the REAL score ? is it a realy single-use-needed-SetTeamScore ? i.e. its 1-0 and you use that function to say it is 1337-0. On next point; will it be 1338-0 or 2-0 ?

Yes the hack (sample plugin) changes the real value. Set it and forget it. I should also mention the sample plugin requires sm 1.4.2 or it will crash :p. As a short explanation of what it does, the game rules class has 2 private member vars that keep track of the score. The offsets are to the addresses of the vars. Also the offset might be wrong for Linux since I only tested in windows.

RedSword 04-20-2012 00:35

Re: [DEV] Gamerules Hax
 
Cool ! Nice job.

Also; why not post this a feature/bug request to get SetTeamScore replaced ? (it may need a bool arg. or Ex suffix for maybe backward compatibility problems.) I'm curious about what's is needed to improve a function; if your's not enough :$.

Dr!fter 04-24-2012 12:51

Re: [DEV] Gamerules Hax
 
Quote:

Originally Posted by RedSword (Post 1692751)
Cool ! Nice job.

Also; why not post this a feature/bug request to get SetTeamScore replaced ? (it may need a bool arg. or Ex suffix for maybe backward compatibility problems.) I'm curious about what's is needed to improve a function; if your's not enough :$.

Its only for cs:s other games dont store the score in gamerules for example tf2 dosnt store in gamerules (I didnt test any other game besides cs:s and tf2). Im not even sure where its stored. I might add a native for cs:s (CS_SetTeamScore for example) to sourcemod's cstrike extension.

Powerlord 04-24-2012 13:20

Re: [DEV] Gamerules Hax
 
Quote:

Originally Posted by Dr!fter (Post 1695709)
Its only for cs:s other games dont store the score in gamerules for example tf2 dosnt store in gamerules (I didnt test any other game besides cs:s and tf2). Im not even sure where its stored. I might add a native for cs:s (CS_SetTeamScore for example) to sourcemod's cstrike extension.

I know TF2 has methods for manipulating the scores in the GameRules Proxy (tf_gamerules entity) to adjust the scores. Then again, scoring in TF2 is a lot more complicated than scoring in CS:S due to teams switching sides, scores in arena being the number of rounds in a row a team has won, etc...

asherkin 08-11-2012 18:51

Re: [DEV] Gamerules Hax
 
Moved to Snippets as it's just a thin wrapper around a gamedata file.

Riser 10-01-2012 13:35

Re: [DEV] Gamerules Hax
 
Any idea how to get this to work on CSGO? Doesn't seem to save scores for me lol.


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

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