http://forum.wc3edit.net/map-deprotecti ... t2913.html
Just look at the endglobals part. Ctrl+F, find "CheatUse". That's the function with all the cheats in it. Then, just find the command you want.
To show you, I'll break down the gold command.
The first part of it is this:
if SubString(s2s,0,6)=="-gold "then
That's basically checking if a player with the cheats enabled has typed "-gold"
And then, if it detects this, it does this, the next line:
call SetPlayerState(p2p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p2p,PLAYER_STATE_RESOURCE_GOLD)+S2I(SubString(s2s,6,13)))
To make that easier:
call SetPlayerState
That part is setting the state of the player (these codes are all fairly self-explanatory), with the arguments in parentheses. If you open it in JassCraft, you can see what each of the arguments are supposed to be. If it won't appear for you, then just type in a parenthesis right after State, and a little popup box will appear to show you the arguments.
The first argument is the player whose state is being changed, and it is:
(p2p,
p2p is the person that triggered the cheat, the one who typed -gold.
The second argument:
PLAYER_STATE_RESOURCE_GOLD,
That's also simple. It's setting the gold of that player.
And the third argument (I'll break this up):
GetPlayerState(p2p,PLAYER_STATE_RESOURCE_GOLD)
GetPlayerState is just checking the player's state. It has p2p as the first argument, so it's checking p2p's state. The second argument is PLAYER_STATE_RESOURCE_GOLD, so it's checking their gold.
Then, at the end of the third argument of SetPlayerState is this:
+S2I(SubString(s2s,6,13)))
S2I converts a string to an integer. As an argument, it has SubString, which has its own arguments. The first of SubString's arguments is s2s, which is whatever is typed by the person that typed -gold. The second is the starting point of what it's checking in the string, and the second is the end point. It's checking characters 6 through 13 of what the player types. Basically, everything after -gold.
So, overall, it's setting p2p's gold to (whatever p2p's current gold is) plus (whatever numbers they typed after -gold).
Get it? The rest are fairly self-explanatory, and JassCraft can tell you what each argument is, too. If you need any more help understanding something, just post back!