SAMP Cursor C++

Prefixobjekt

Active member
Joined
Aug 1, 2014
Messages
55
Reaction score
0
Hi,

i need to make a function to show the samp cursur without opening the chat

i use this from s0b

problem: invisible cursor..

Code:
void toggleSAMPCursor(int iToggle)
{
	if (g_SAMP == NULL) return;
	if (g_Input->iInputEnabled) return;

	void		*obj = *(void **) (g_dwSAMP_Addr + SAMP_MISC_INFO);
	((void(__thiscall *) (void *, int, bool)) (g_dwSAMP_Addr + SAMP_FUNC_TOGGLECURSOR))(obj, iToggle ? 3 : 0, !iToggle);
	if (!iToggle)
		((void(__thiscall *) (void *)) (g_dwSAMP_Addr + SAMP_FUNC_CURSORUNLOCKACTORCAM))(obj);
	// g_iCursorEnabled = iToggle;
}


Problem is if im using this, cursor isnt shown, but the screen is frozen like chat is open and cursorposition is still changing if im moving my mouse.

any other methods?
anyone have same problem?
 

0x_

Wtf I'm not new....
Staff member
Administrator
Joined
Feb 18, 2013
Messages
1,123
Reaction score
174
Try around with the second parameter.
& If you use it properly It'll show the cursor.

[shcode=cpp]
void SAMP::CGame::ToggleCursor(int unk, bool unk2)
{
    int(__thiscall *CGame__ToggleCursor)(void *_this, int unk, bool unk2) = ((int(__thiscall *)(void *_this, int unk, bool unk2))(m_dwModule + CSAMPOffsets::FUNC__CGame__ToggleCursor));
    CGame__ToggleCursor((void*)m_dwThis, unk, unk2);
}

void SAMP::CGame::ToggleCursor(bool bToggle)
{
    ToggleCursor(bToggle ? 2 : 0, bToggle);
}
[/shcode]
 

Prefixobjekt

Active member
Joined
Aug 1, 2014
Messages
55
Reaction score
0
Its the same Func? m_dwModule + CSAMPOffsets::FUNC__CGame__ToggleCursor


m_dwThis -> SAMP_MISC_INFO ?
m_dwModule -> SAMP PTR

i tryed this way, but still same, as before :)
 
Top