Talk:0413

From GTAMods Wiki
Revision as of 20:18, 2 February 2015 by Seemann (talk | contribs)
Jump to navigation Jump to search

Code snippet

I see something wrong with the code. The first parameter (0@) gets new value in the function's top, so its value is rewritten. What's the point of passing a player handle then? Seemann (talk) 11:38, 2 February 2015 (UTC)

I had wanted to copy the format of the opcode but there's no CLEO opcode to get the location of the player struct, so I used a memory address directly. 0@ is labeled as a placeholder. Is it better to omit it?--Spaceeinstein (talk) 19:09, 2 February 2015 (UTC)
0x94AD28 is the starting address of the array of players. Each struct is 368 bytes of length, so I assume you wanted something like this:
:opcode_0413
// 0@ - input param (player handle)
// 1@ - input param (flag)
0@ *= 368
0@ += 0x94AD28
0@ += 0x145
05DF: write_memory 0@ size 1 value 1@ virtual_protect 0
05F6: ret 0

Otherwise you can just omit the first parameter passed into the function. Seemann (talk) 20:18, 2 February 2015 (UTC)