SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 05/07/2018, 12:18 PM   #1
TadePoleMG
Big Clucker
 
TadePoleMG's Avatar
 
Join Date: Apr 2018
Location: Uttar Pradesh, India
Posts: 164
Reputation: 2
Default Dialog Help

Hi mates

Example Dialog Code:
PHP Code:
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.
__________________
-| Gaming 'N' Scripting |-
TadePoleMG is offline   Reply With Quote
Old 05/07/2018, 12:34 PM   #2
kovac
Banned
 
Join Date: Mar 2018
Posts: 178
Reputation: 14
Default Re: Dialog Help

I would recommend you this include for creating dialogs much simpler: http://forum.sa-mp.com/showthread.php?t=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 Code:
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!

kovac is offline   Reply With Quote
Old 05/07/2018, 12:41 PM   #3
TadePoleMG
Big Clucker
 
TadePoleMG's Avatar
 
Join Date: Apr 2018
Location: Uttar Pradesh, India
Posts: 164
Reputation: 2
Default Re: Dialog Help

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.
__________________
-| Gaming 'N' Scripting |-
TadePoleMG is offline   Reply With Quote
Old 05/07/2018, 12:49 PM   #4
kovac
Banned
 
Join Date: Mar 2018
Posts: 178
Reputation: 14
Default Re: Dialog Help

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.
kovac is offline   Reply With Quote
Old 05/07/2018, 01:40 PM   #5
Lokii
Huge Clucker
 
Join Date: Sep 2017
Posts: 338
Reputation: 85
Default Re: Dialog Help

Quote:
Originally Posted by TadePoleMG View Post
Hi mates

Example Dialog Code:
PHP Code:
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 Code:
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"Account Settings""1. Change Name\n2. Change Password""Change""Close"); 

Quote:
Originally Posted by TadePoleMG View Post
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 Code:
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

Lokii is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[DIALOG]How i Create A dialog Whent Player Login To Enter in Dialog The Password donhu789 Scripting Help 8 29/09/2013 07:15 AM
Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID Blackazur Scripting Help 1 30/04/2013 06:25 PM
[Dialog] Listing MySQL data inside a List Dialog vIBIENNYx Scripting Help 11 10/09/2012 11:19 PM
[19:58:45] Warning: PlayerDialogResponse PlayerId: 28 dialog ID doesn't match last sent dialog ID, what it means? niels44 Scripting Help 6 13/06/2012 05:53 PM
Big problem (PlayerDialogResponse PlayerId: 57 dialog ID doesn't match last sent dialog ID) RingoRus Server Support 3 12/06/2012 05:54 PM


All times are GMT. The time now is 11:05 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.