Giter Club home page Giter Club logo

tdialog's Introduction

TDialog

TDialog helps scripters organize their scripts and optimize dialogs. It has new features that are not in the normal samp-team dialog. One of the new features is that there is no need to declare a format function to include variables and other strings inside it.

Installation

Simply install to your project:
Include in your code and begin using the library:

#include <TDialog>

Functions

/*
PARAMS:  
function[] - The function of a dialog to show.
header[] - The header of a dialog to show it.
{Float,_}:... - The variable to store the data  
  
RETURNS:  
1 on success, otherwise 0  
*/
TDialog_SetHeader(function[], const header[], {Float,_}:...);

/*
PARAMS:
function[] - The function of a dialog to show.
info[] - The info of a dialog to show it.
{Float,_}:... - The variable to store the data  
  
RETURNS:  
1 on success, otherwise 0  
*/
TDialog_SetInfo(function[], const info[], {Float,_}:...);

/*
PARAMS:  
playerid - The player to see the dialog.
function[] - The function of dialog to show.
dialog_type - The dialog type of dialog (TDIALOG_MSG, TDIALOG_LIST, TDIALOG_TABLIST, TDIALOG_TABLIST_HEAD, TDIALOG_INPUT, TDIALOG_PASS)
button0[] - The button0 of a dialog to show it.
button1[] - The button1 of a dialog to show it.
  
RETURNS:  
1 on success, otherwise 0  
*/
TDialog_Show(playerid, const function[], dialog_type, const button0[], const button1[]);

Usage

#include <a_samp>
#include <TDialog>

public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    TDialog_SetHeader(Test, "%s", name);
    TDialog_SetInfo(Test, "Hello there.");
    TDialog_Show(playerid, Test, TDIALOG_MSG, "Ok", ""); 
    return 1;
}

Callbacks

TDialogCall:Test(playerid, response, listitem, inputtext[])
{
    // Code
    return 1;
}

Replacements

DIALOG_STYLE_MSGBOX          --> TDIALOG_MSG
DIALOG_STYLE_LIST            --> TDIALOG_LIST
DIALOG_STYLE_TABLIST         --> TDIALOG_TABLIST
DIALOG_STYLE_TABLIST_HEADERS --> TDIALOG_TABLIST_HEAD
DIALOG_STYLE_INPUT           --> TDIALOG_INPUT
DIALOG_STYLE_PASSWORD        --> TDIALOG_PASS

tdialog's People

Contributors

tiyonotfound avatar zaxx4582 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.