The basics to create a cheats


Cheats can be added to CheatDevice by creating text files in the:
/cheats

Commands: (case sensitive)

#cheat Cheat Title
#off
// comments
setchar(startaddress, intvalue, ...);
sethex(startaddress, hexintvalue, ...;
setshort(startaddress, intvalue, ...);
setint(startaddress, intvalue, ...);
setfloat(startaddress, floatvalue, ...);
teleport(x, y, z);
off();
--------------------------------------------------------------------------

Formats for numeric constants:

decimal: 123
hex: 0xABCF0 or 0xabcf0
binary: 0b00100101101
float: 1.23
character: 'a', 'b', 'c', '\n'
---------------------------------------------------------------------------
Special pointer constants:

pplayer: Pointer to player object.
pcar: Pointer to player's car object. Any command that uses this
only executes when the player is in a car.
pobj: Pointer to player object if on foot, or player's car object
if in a vehicle.

--------------------------------------------------------------------------

Examples:

#cheat Teleport: Top of Tall Building
teleport(95, -1509, 216.98);

#cheat Hud On
setchar(0x09a63418, 1);

#cheat Hud Off
setchar(0x09a63418, 0);

#cheat Max Money
setint(0x08bde55c, 99999999);
setint(0x08bde55c, 99999999);

--------------------------------------------------------------------------
Functions with "..." can write any number of values starting at the given
address, so Max Money could also be written as:

#cheat Max Money
setint(0x08bde55c, 99999999, 99999999);

#cheat No Money
setint(0x08bde55c, 0, 0);

#cheat Time is 9:30am
setchar(0x08bb3b40, 9, 30);
---------------------------------------------------------------------------
The #off section is used to set a value back to its normal setting and is
executed a single time when a cheat is turned off. For example:

// by winchy
#cheat Invisible Vic
setchar(pplayer + 0x4C, 0x10, 0x20);
#off
setchar(pplayer + 0x4C, 0, 0);

// by chrislawrance
#cheat Lock Camera
setchar(pplayer + 0x550, 1);
#off
setchar(pplayer + 0x550, 0);
--------------------------------------------------------------------------
Integer values can be treated as signed or unsigned. All of the following
commands set the same value:

setchar(0x08bde55c, 255);
setchar(0x08bde55c, -1);
setchar(0x08bde55c, 0xff);
setchar(0x08bde55c, 0xFF);
setchar(0x08bde55c, 0b11111111);
sethex(0x08bde55c, ff);

sethex is just a version of setchar that assumes all values are hex so you
can leave off the 0x.