Cheat engine & Dialogs
#8

Instead of relying on the client's response, you should try and keep everything server-sided if possible.

For example:
PHP Code:
#define DIALOG_TEST 1

#define MAX_LIST_ITEMS 25        // The maximum amount of list items
#define MAX_LIST_ITEM_TEXT 60    // The maximum length a list item text can be

new
    
ListItem[MAX_PLAYERS][MAX_LIST_ITEMS][MAX_LIST_ITEM_TEXT],
    
Player_ListItem[MAX_PLAYERS] = {0, ...}
;

#define AddListItem(%0,%1) format(ListItem[(%0)][Player_ListItem[(%0)]++], sizeof(ListItem[][]), (%1))
#define ClearListItems(%0); for(new litem = 0; litem != sizeof(ListItem[]); litem++) ListItem[(%0)][litem][0] = EOS; Player_ListItem[(%0)] = 0;

public OnPlayerSpawn(playerid)
{
    
AddListItem(playerid"1. Briefcase");
    
AddListItem(playerid"2. Torn Letter");
    
AddListItem(playerid"3. Cyanide Pills");
    
AddListItem(playerid"4. Toolbox");
    
ShowListDialog(playeridDIALOG_TEST, .caption "Items List");
    return 
1;
}

ShowListDialog(playeriddialogidcaption[] = "Dialog")
{
    new 
dialog_str[MAX_LIST_ITEMS MAX_LIST_ITEM_TEXT];
    for(new 
0sizeof(ListItem[]); i++)
    {
        if(
ListItem[playerid][i][0] == EOS) break;
        
format(dialog_strsizeof(dialog_str), "%s\n%s"dialog_strListItem[playerid][i]);
    }
    return 
ShowPlayerDialog(playeriddialogidDIALOG_STYLE_LISTcaptiondialog_str"Select""Exit");
}

public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
response)
    {
        switch(
dialogid)
        {
            case 
DIALOG_TEST:
            {
                
printf("%s | %s"inputtextListItem[playerid][listitem]);
                if(
strcmp(inputtextListItem[playerid][listitem], true) != 0)
                {
                    
// inputtext does not match the list item text they selected
                    //Kick(playerid);
                    
return 0;
                }
                
ClearListItems(playerid); // Reset the player's list items text
                
return 1;
            }
        }
    }
    return 
0;

And I repeat, that is purely an example. You should make something that fits your own needs.
Reply


Messages In This Thread
Cheat engine & Dialogs - by Naruto_Emilio - 09.11.2016, 19:17
Re: Cheat engine & Dialogs [+4 REP] - by SickAttack - 09.11.2016, 20:00
Re: Cheat engine & Dialogs [+4 REP] - by Naruto_Emilio - 09.11.2016, 20:03
Re: Cheat engine & Dialogs [+4 REP] - by SickAttack - 09.11.2016, 20:04
Re: Cheat engine & Dialogs [+4 REP] - by Naruto_Emilio - 12.11.2016, 18:54
Re: Cheat engine & Dialogs [+4 REP] - by Micko123 - 12.11.2016, 19:00
Re: Cheat engine & Dialogs [+4 REP] - by MikeB - 13.11.2016, 02:09
Re: Cheat engine & Dialogs [+4 REP] - by Threshold - 13.11.2016, 06:04
Re: Cheat engine & Dialogs [+4 REP] - by Naruto_Emilio - 14.11.2016, 19:39
Re: Cheat engine & Dialogs [+4 REP] - by PrO.GameR - 14.11.2016, 20:01
Re: Cheat engine & Dialogs [+4 REP] - by Threshold - 15.11.2016, 09:39
Re: Cheat engine & Dialogs [+4 REP] - by Micko123 - 15.11.2016, 10:06
Re: Cheat engine & Dialogs - by TwinkiDaBoss - 15.11.2016, 13:05
Re: Cheat engine & Dialogs - by Threshold - 15.11.2016, 22:30
Re: Cheat engine & Dialogs - by SickAttack - 15.11.2016, 22:44

Forum Jump:


Users browsing this thread: 1 Guest(s)