Raised This Month: $32 Target: $400
 8% 

[DEV] Gamerules Hax


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 04-19-2012 , 16:51   [DEV] Gamerules Hax
Reply With Quote #1

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
Attached Files
File Type: txt gameruleshax.games.txt (641 Bytes, 389 views)
File Type: inc gameruleshax.inc (218 Bytes, 447 views)
File Type: sp Get Plugin or Get Source (gameruleshax.sp - 879 views - 1.3 KB)

Last edited by Dr!fter; 04-19-2012 at 17:04.
Dr!fter is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 04-19-2012 , 16:56   Re: [DEV] Gamerules Hax
Reply With Quote #2

w00t, nice

Thank you for this
__________________
View my Plugins | Donate
TnTSCS is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 04-19-2012 , 22:52   Re: [DEV] Gamerules Hax
Reply With Quote #3

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 ?
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work

Last edited by RedSword; 04-19-2012 at 22:52.
RedSword is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 04-20-2012 , 00:29   Re: [DEV] Gamerules Hax
Reply With Quote #4

Quote:
Originally Posted by RedSword View Post
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.
Dr!fter is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 04-20-2012 , 00:35   Re: [DEV] Gamerules Hax
Reply With Quote #5

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 :$.
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work

Last edited by RedSword; 04-20-2012 at 00:35.
RedSword is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 04-24-2012 , 12:51   Re: [DEV] Gamerules Hax
Reply With Quote #6

Quote:
Originally Posted by RedSword View Post
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.
Dr!fter is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-24-2012 , 13:20   Re: [DEV] Gamerules Hax
Reply With Quote #7

Quote:
Originally Posted by Dr!fter View Post
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...
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-24-2012 at 13:21.
Powerlord is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 08-11-2012 , 18:51   Re: [DEV] Gamerules Hax
Reply With Quote #8

Moved to Snippets as it's just a thin wrapper around a gamedata file.
__________________
asherkin is offline
Riser
Junior Member
Join Date: Sep 2012
Old 10-01-2012 , 13:35   Re: [DEV] Gamerules Hax
Reply With Quote #9

Any idea how to get this to work on CSGO? Doesn't seem to save scores for me lol.
Riser 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 07:52.


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