TogglePlayerControllable

BBB

Active member
Joined
Apr 5, 2013
Messages
62
Reaction score
1
I've created a function to enable/disable player control, but it sometimes freezes my game -.-
pls help

Code:
void ToggleFreeze(int b)
{
	DWORD addr = (DWORD)GetModuleHandle(L"samp.dll");
	if(!addr)
		return;
	DWORD playerptr = addr+0x212A4C;  //some ptr
	DWORD func1 = (addr+0x1010);     // found that in olly, it gets a player ptr or sth
	DWORD func2 = addr + 0x6DC70;  //freeze func
	__asm
	{
		mov eax, dword ptr[playerptr]
		mov ecx, dword ptr[eax]
		call func1
		mov ecx, eax
		push b
		call func2
	}
}
 

0x_

Wtf I'm not new....
Staff member
Administrator
Joined
Feb 18, 2013
Messages
1,123
Reaction score
174
samp freezes your game if it detects suspicous things, look at the m0d_sa source or in my "collection of 0.3x offsets"
 

BBB

Active member
Joined
Apr 5, 2013
Messages
62
Reaction score
1
I don't know if I interpreted it correctly :/
patch samp R1-2 like this?
it dind't work..

Code:
WriteMem(( addr + 0x60FF0 ), (DWORD)"\x8B\x54\x24\x08", 4);
*((BYTE*)( addr + 0x60FF0 )) = 0xC3;
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
Hmm i can see what the problem is...

You're calling a function from samp module... so ofcourse as 0x688 said, samp is detecting outside calls...

there is a way to toggleplayercontrollable by nopping a few code in gta_sa.exe
 

BBB

Active member
Joined
Apr 5, 2013
Messages
62
Reaction score
1
/e fail
works perfectly thanks
 
Top