Help Help Me (C++, mod_sa)

NewYorker

Member
Joined
Nov 30, 2021
Messages
11
Reaction score
0
Location
USA NY STATE
Hello, I have such a code, but I could not use it in my project because I do not have much knowledge about dialogue. I tried a few times with Show_Dialog, but my game crashed every time. (0.3DL) Can you help me use it?

C++:
#define SAMP_DIALOG_INFO_OFFSET                0x2AC9E0
#define SAMP_DIALOG_SHOW_OFFSET                0x6FA50
void Show_Dialog(UINT16 wDialogID, UINT8 bDialogStyle, char* szTitle, char* szButton1, char* szButton2, char* szInfo)
{
    if (g_SAMP == NULL) return;

    {
        void* Connection = *(void**)(g_dwSAMP_Addr + SAMP_DIALOG_INFO_OFFSET);
        ((void(__thiscall*)
            (void*, int, int, char*, char*, char*, char*)) (g_dwSAMP_Addr + SAMP_DIALOG_SHOW_OFFSET))(Connection, wDialogID, bDialogStyle, szTitle, szButton1, szButton2, szInfo);
    }

}
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Hello, I have such a code, but I could not use it in my project because I do not have much knowledge about dialogue. I tried a few times with Show_Dialog, but my game crashed every time. (0.3DL) Can you help me use it?

C++:
#define SAMP_DIALOG_INFO_OFFSET                0x2AC9E0
#define SAMP_DIALOG_SHOW_OFFSET                0x6FA50
void Show_Dialog(UINT16 wDialogID, UINT8 bDialogStyle, char* szTitle, char* szButton1, char* szButton2, char* szInfo)
{
    if (g_SAMP == NULL) return;

    {
        void* Connection = *(void**)(g_dwSAMP_Addr + SAMP_DIALOG_INFO_OFFSET);
        ((void(__thiscall*)
            (void*, int, int, char*, char*, char*, char*)) (g_dwSAMP_Addr + SAMP_DIALOG_SHOW_OFFSET))(Connection, wDialogID, bDialogStyle, szTitle, szButton1, szButton2, szInfo);
    }

}

0.3.7 R1
PHP:
void SAMP::CDialog::Show(int nId, int nType, const char *szCaption, const char *szText, const char *szLeftButton, const char *szRightButton, BOOL bServerside) {
 ((void(__thiscall *)(CDialog *, int, int, const char *, const char *, const char *, const char *, BOOL))SAMP_ADDROF(0x6B9C0))(this, nId, nType, szCaption, szText, szLeftButton, szRightButton, bServerside);
}
 

BaHeK

Member
Joined
Mar 6, 2013
Messages
9
Reaction score
4
Hello, I have such a code, but I could not use it in my project because I do not have much knowledge about dialogue. I tried a few times with Show_Dialog, but my game crashed every time. (0.3DL) Can you help me use it?

C++:
#define SAMP_DIALOG_INFO_OFFSET                0x2AC9E0
#define SAMP_DIALOG_SHOW_OFFSET                0x6FA50
void Show_Dialog(UINT16 wDialogID, UINT8 bDialogStyle, char* szTitle, char* szButton1, char* szButton2, char* szInfo)
{
    if (g_SAMP == NULL) return;

    {
        void* Connection = *(void**)(g_dwSAMP_Addr + SAMP_DIALOG_INFO_OFFSET);
        ((void(__thiscall*)
            (void*, int, int, char*, char*, char*, char*)) (g_dwSAMP_Addr + SAMP_DIALOG_SHOW_OFFSET))(Connection, wDialogID, bDialogStyle, szTitle, szButton1, szButton2, szInfo);
    }

}
void Show_Dialog(int nId, int nType, const char* szCaption, const char* szText, const char* szLeftButton, const char* szRightButton)
{
((void(__thiscall*)(stDialogInfo*, int, int, const char*, const char*, const char*, const char*, BOOL))(g_dwSAMP_Addr + 0x6B9C0)))(this, nId, nType, szCaption, szText, szLeftButton, szRightButton, NULL);
}
 
Top