NexiusTailer / Nex-AC

Anticheat system
https://pawn.wiki/index.php?/topic/27641-nex-ac/
GNU Lesser General Public License v3.0
212 stars 156 forks source link

Nex-AC Prevent PreviewModelDialog response #274

Closed AthallahDzaki closed 2 years ago

AthallahDzaki commented 2 years ago

How to reproduce :

#include <nex-ac>
#include <PreviewModelDialog2>

ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PREVIEW_MODEL, "Vehicle Rental", "400\tTest", "Select", "Close");

OnDialogResponse(...)
{
    if(dialogid == 0)
    {
        //....
    }
}

Output :

[2022-09-04T11:26:21Z] [Info] [Nex-AC debug] AC dialog: -1, dialogid: 19, listitem: 0
[2022-09-04T11:26:21Z] [Info] [Nex-AC] Suspicion on the ID 0. Reason code: 039
NexiusTailer commented 2 years ago

This is because it modify the behaviour of standart SA-MP natives which is a bad practise. ~Checking its source code I noticed it also adds ShowPreviewModelDialog function, so, try to use it instead of hooked ShowPlayerDialog with DIALOG_STYLE_PREVIEW_MODEL.~

UPD: checking and testing its latest version (as previously I found something more older) it seems to be working if nex-ac is included after PreviewModelDialog. This is probably because modifying the default native and adding some conditional checks to it in PreviewModelDialog, they are executed first in the hook chain and create some problems with this for all hooks remained. Changing the include order solve this.