Dialog Help
#1

Hi mates

Example Dialog Code:
PHP код:
new string[128];
format(string,128,"1. Change Name\n2. Change Password");
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"Account Settings"string"Change""Close"); 
So, guys OnDialogResponse if Player money is less than $1000 then any of them list items can't be clickable and if player's money is greater than $1000 then both be clickable and pop up a new dialog for entering new name/pass.

How i do that?

Thank You, Help Please.
Reply
#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
#3

Thank You but i know this i want that id cash is less than $1000 then first list item can't be clickable means shows in dialog list but not clickable instead of error msg.
Reply
#4

Sorry, but I can't understand what you're saying.
If you want to check money only in specific listitems, simply move that line of code inside it.

Edit: I don't think that is possible. However, you can show dialog again once player responses which would make the same effect.
Reply
#5

Quote:
Originally Posted by TadePoleMG
Посмотреть сообщение
Hi mates

Example Dialog Code:
PHP код:
new string[128];
format(string,128,"1. Change Name\n2. Change Password");
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"Account Settings"string"Change""Close"); 
So, guys OnDialogResponse if Player money is less than $1000 then any of them list items can't be clickable and if player's money is greater than $1000 then both be clickable and pop up a new dialog for entering new name/pass.

How i do that?

Thank You, Help Please.
why not just

PHP код:
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"Account Settings""1. Change Name\n2. Change Password""Change""Close"); 
Quote:
Originally Posted by TadePoleMG
Посмотреть сообщение
Thank You but i know this i want that id cash is less than $1000 then first list item can't be clickable means shows in dialog list but not clickable instead of error msg.
PHP код:
case 0:

    if(
GetPlayerMoney(playerid) < 1000) return ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"Account Settings""1. Change Name\n2. Change Password""Change""Close"); 
    
//if got 1000 or above code here

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)