Hi, I'm trying to simulate a left mouse click in SA:MP using memory addresses.
0xB73458 Controls block
+0x22 = [WORD] Fire
0 = OFF
255 = ON
Here is my code:
I thought it must be write protected.
^ How come my gun won't fire when I set the value of 0xB7347A to 255? For some reason it only works when I make a cleo.
3@ = 0xB73458
3@ += 34
write_memory 3@ size 4 value 255 virtual_protect 0 <-- Works?
0xB73458 Controls block
+0x22 = [WORD] Fire
0 = OFF
255 = ON
Here is my code:
Code:
*(WORD*)(0xB73458 + 0x22) = 255;
I thought it must be write protected.
Code:
unsigned long oldProtection;
VirtualProtect((LPVOID)0xB7347A, 1, PAGE_EXECUTE_READWRITE, &oldProtection);
^ How come my gun won't fire when I set the value of 0xB7347A to 255? For some reason it only works when I make a cleo.
3@ = 0xB73458
3@ += 34
write_memory 3@ size 4 value 255 virtual_protect 0 <-- Works?