Dialog Help
#2

I would recommend you this include for creating dialogs much simpler: https://sampforum.blast.hk/showthread.php?tid=475838
Also, checking for client-side money is a very bad idea, use server-sided. Else It can be easily hacked.

However, this should work:
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
1// DIALOG ID. IT'S BETTER TO USE DEFINES IF YOU DON'T USE EASYDIALOG
        
{
            if(
response)
            {
                if(
GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, -1"ERROR: You don't have enough cash.");
                switch(
lisitem)
                {
                    case 
0// Listitem 1
                    
{
                        
// ..
                    
}
                    case 
1// Listitem 2
                    
{
                        
// ..
                    
}
                }
            }
            
        }
        return 
1// We handled a dialog, so return 1.
    
}
    return 
0// You MUST return 0 here!

Reply


Messages In This Thread
Dialog Help - by TadePoleMG - 05.07.2018, 12:18
Re: Dialog Help - by kovac - 05.07.2018, 12:34
Re: Dialog Help - by TadePoleMG - 05.07.2018, 12:41
Re: Dialog Help - by kovac - 05.07.2018, 12:49
Re: Dialog Help - by Lokii - 05.07.2018, 13:40

Forum Jump:


Users browsing this thread: 1 Guest(s)