Client Login Portal   News Support
  • 5
  •   Request Server
  •   Control Panel
  •   Services
  •   
     Ultra-Host - Portal
    Ultra-Host - Portal
    Dear Guest! You are not registered or logged in! Click here to register or click here to login.




    You are not registered or logged in! Click here to register or click here to login.



    [Tutorial]how to make dialogs. (Read 64 times)
    Posted: April 27, 2020 20:15:23
    Offline xTrevor
    Member

     
     
    Posts: 50
    Private message
    [Tutorial]how to make dialogs.
     
     
    Hello Everyone so many Scripters dont know how to make dialogs so i ll show you how ot make it today
    follow all my steps and if you got any problem just message me

    Step 1 : we ll start with "OnPLayerConnect"

     public OnPlayerConnect(playerid) 
    // add this first on your script

    write under it

     ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Welcome to my SA:MP Server!","Write somethin here","Button1","Button2"); 


    Step 2 : now OnDialogRespond

     public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) 


    Write Under it

    if(dialogid == 1)
    {
        if(response == 1)
           {
                switch(listitem)
                {
                    case 0:
                    {
     
                    }
                    case 1:
                    {
     
                    }        
     
     
                }
     
          }     
    }
    return 1;
    } 


    you can add in case 1 if its the server rules the 2nd button will be "No" then he will be kicked so add this if you want to kick him if he press No button

    case 1:
    {
     Kick(playerid);
     SendClientMessage(playerid,color,"you are kicked");
    } 



    ok We Finish this!
    lets go to another dialog style !

    OnPlayerConnect(playerid) 


    add under it

    ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST ,"Welcome to my SA:MP Server!","Write Somethin","Button1","Button2"); 



    ok this the Style list, you can add in "write somethin" like : Our Commandn cmd here"
    NOTE : n <--- for New Line
    and the Dialog Response Same as other, you can delete kick !
    ok now to Dialog Style password

    OnPlayerConnect(playerid); 


    add under it

    ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD ,"Welcome","Write your password","Button1","Button2"); 



    the response u can make it like if he did "Cancel" "Note : you can change the button2 to cancel" he will be kicked!

    case 1:
    {
     Kick(playerid);
    } 



    Now lets go to OnPlayerCommandText !

     public OnPlayerCommandText(playerid, cmdtext[]) 


    Write under it with any style dialog, dont write the pass style because hes already logged in so.

     public OnPlayerCommandText(playerid, cmdtext[])
    {
        if (strcmp("/your command", cmdtext, true, 6) == 0)
        {
            ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Write here somethin","Blalblalba","Button1","Button2"); // you can change the dialog style so
     
            return 1;
        }
        return 0;
    } 



    now on response :

     public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
        if(dialogid == 2)
        {
        if(response == 1)
           {
                switch(listitem)
                {
                    case 0:
                    {
     
                    }
                    case 1:
                    {
     
                    }
     
     
                }
     
           }        
        }
        return 1;
    }



    you can add under case's everything like SendClientMessage and GivePlayer Gun, SetPlayerHealth Etc..
    Enjoy this Tutorial, if there is something wrong, please let me know. thanks


     
    Posted: April 27, 2020 20:22:51
    Offline xTrevor
    Member

     
     
    Posts: 50
    Private message
    Re: [Tutorial]how to make dialogs.
     
     
    includes
    zcmd
    a_samp




    add this at the end of your filterscript if you using it only add it

    #endif ( new line )


     
    Posted: May 11, 2020 9:23:23
    Offline 4Life
     
    Premium User
     

     
     
    Posts: 4
    Private message
    Re: [Tutorial]how to make dialogs.
     
     
    Barely a tutorial. No explanation.


     
    Posted: May 11, 2020 16:24:45
    Offline xTrevor
    Member

     
     
    Posts: 50
    Private message
    Re: [Tutorial]how to make dialogs.
     
     
    i tried my best sorry if you didnt understand


     
    Posted: May 11, 2020 16:39:42
    Offline 4Life
     
    Premium User
     

     
     
    Posts: 4
    Private message
    Re: [Tutorial]how to make dialogs.
     
     
    You should've atleast comment on what those code should do.

    Example:
    Kick(playerid); // Kick the player 


     


    Statistics
    Services
    Support

    - Online servers: 714
    - Registered users: 125,801
    - Uptime: 7 years, 3 months and 22 days.

    © Ultra-Host v9.2 (2013-2020) - All Rights Reserved.