Help with dialogs
#8

Try this.
Edit the items/selections you want on your one. Good luck.
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
if(
response)// They pressed the first button. 
    
{
    switch(
dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs. 
        
{
        case 
1:// Our dialog!
            
{
               switch(
listitem)// Checking which listitem was selected
            
{
                case 
0:// The first item listed
                
{
                    if(
GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                    
GivePlayerMoney(playerid, -1);
                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_SPRUNK);
                }
                case 
1// The second item listed
                
{
                    if(
GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                    
GivePlayerMoney(playerid, -2);
                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_BEER);
                }
                case 
2// The third item listed
                
{
                    if(
GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid0xFFFFFF"You don't have enough cash.");
                    
GivePlayerMoney(playerid, -3);
                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_DRINK_WINE);
                }
            }
            }
    }
    }
    return 
1;

Reply


Messages In This Thread
Help with dialogs - by Kain1297 - 09.07.2012, 23:42
Re: Help with dialogs - by coole210 - 10.07.2012, 00:06
Respuesta: Help with dialogs - by Kain1297 - 10.07.2012, 00:10
Re: Help with dialogs - by Larceny - 10.07.2012, 00:12
Respuesta: Help with dialogs - by Kain1297 - 10.07.2012, 00:22
Re: Help with dialogs - by Larceny - 10.07.2012, 00:22
Respuesta: Help with dialogs - by Kain1297 - 10.07.2012, 00:29
Re: Help with dialogs - by Genuine - 10.07.2012, 00:37

Forum Jump:


Users browsing this thread: 1 Guest(s)