Anticheat Patch 0.3z

mrT101

Active member
Joined
Feb 18, 2014
Messages
58
Reaction score
0
T3K link said:
Ok then you maybe can do it this way, BUT i'm not 100% sure...

Code:
void showSampDialog (int send, int dialogID, int typedialog, char * caption, const char * text, char * button1, char * button2)
{ 
uint32_t func = pSAMP + SAMP_DIALOG_SHOW; 
uint32_t data = pSAMP + SAMP_DIALOG_INFO_OFFSET; 

__asm mov eax, dword ptr [data]
__asm mov ecx, dword ptr [eax] //mov to offset
__asm push send //0 - No send response, 1 - Send response
__asm push button2
__asm push button1
__asm push text
__asm push caption
__asm push typedialog
__asm push dialogID
__asm call func
} 


///
std::string List = "12345678";
showSampDialog(0, 0 ,2,"LIST",List.c_str(),"OK","CLOSE");

since c_str() is return a const char* and the parameter needs to be a const char* you won't have problems with the function, unless if the function overwrites the str (list.c_str()) in that case it won't work... but i think it will since it doesn't have any reason to edit it... just try it

Thanks T3K, I tried your suggestion and it still froze the game before the dialog was shown around 30% of the time. I'll try whatever other changes i can think of to get this working. without freezing
 

mrT101

Active member
Joined
Feb 18, 2014
Messages
58
Reaction score
0
Ok, I've been trying some things and have found that:

1. If I use a string literal, the dialog displays each time and there is no freezing at all.
Code:
showSampDialog(0, 0 ,2,"LIST","This is my string","OK","CLOSE");

2.If I use a char* with a constant string there is no freezing and the dialog shows, e.g. :
Code:
char * myString = "This is my text";
showSampDialog(0, 0 ,2,"LIST",myString,"OK","CLOSE");


Does this suggest a solution to the problem?
 
Top