[Include] Static Dialogs - BigETI
#1

This time I want to show you a simply include, where you can store static dialogs and show them for player fast and easy.

What are static dialogs?
Static dialogs are dialogs which you can set and show for any player.

Limits:
  • Max. 128 static dialogs are createable. (Only from ID 0-127) (MAX_STATIC_DIALOGS)
  • Caption of a dialog can store max. 32 cells. (MAX_STATIC_D_CAPTION)
  • Information text of a static dialog can store 1024 cells. (MAX_STATIC_D_INFO)
  • The button 1 and 2 can store each max. 16 cells. (MAX_STATIC_D_BUTTON)

Functions:
  • pawn Код:
    SetStaticDialog(dialogid, style, caption[], info[], button1[], button2[])
    Description: Used to create and/or overwrite a static dialog.
    Returns: True in case of success else False. (Boolean)


  • pawn Код:
    RemoveStaticDialog(dialogid)
    Description: Removes an existing static dialog.
    Returns: True in case of success else False. (Boolean)


  • pawn Код:
    ShowPlayerStaticDialog(playerid, dialogid)
    Description: Shows an existing static dialog to a specific player.
    Returns: Nothing!


  • pawn Код:
    IsStaticDialog(dialogid)
    Description: Checks if the static dialog exists.
    Returns: True if existing else False. (Boolean)


  • pawn Код:
    IsValidStaticDialog(dialogid)
    Description: Checks if the variable "dialogid" is valid.
    Returns: True if valid else False. (Boolean)

Credits:
  • Myself for creating this include.
  • Mikkel_Pedersen for testing this include.
  • SA:MP development team
Downloads:
Pastebin
Solidfiles

Regards: BigETI
Reply
#2

I feel stupid.. Static dialog? Mind showing any screens of what it is, for the other people who have no idea what it is?
Reply
#3

Quote:

I feel stupid.. Static dialog? Mind showing any screens of what it is, for the other people who have no idea what it is?

"Predefined" dialog.

-----

Pretty nice, but you'll have to increase the string limit.

Why this and not the normal one ? The normal one have a very big string limit ( ~4096 char ), yours 128 chars, it's not hard to use Copy + Paste if you want to show the same dialog id in multiple things.
Reply
#4

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
"Predefined" dialog.

-----

Pretty nice, but you'll have to increase the string limit.

Why this and not the normal one ? The normal one have a very big string limit ( ~4096 char ), yours 128 chars, it's not hard to use Copy + Paste if you want to show the same dialog id in multiple things.
The limit of the static dialogs are 128 while the information string can max get a string with 1024 cells.
Read the limits clearly above.
Reply
#5

I don't really see a big difference, only a few formats, other than that I don't see a big difference.
Reply
#6

almost nothing....
2/10
Reply
#7

First of all I just made this include in a few minutes and second with this you can just show dialogs which you don't have to copy/paste all the time

Example:
Without this include:
pawn Код:
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "My Dialog", "This is a dialog.\nAll the stuff have to be shown without any changes", "OK", "");
//..Somewhere in your script
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "My Dialog", "This is a dialog.\nAll the stuff have to be shown without any changes", "OK", "");
//..Somewhere in your script
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "My Dialog", "This is a dialog.\nAll the stuff have to be shown without any changes", "OK", "");
With this include:
pawn Код:
//For example OnGameModeInit
SetStaticDialog(0, DIALOG_STYLE_MSGBOX, "My Dialog", "This is a dialog.\nAll the stuff have to be shown without any changes", "OK", "");
//Somewhere in your script
ShowPlayerStaticDialog(playerid, 0);
//Again somewhere in your script
ShowPlayerStaticDialog(playerid, 0);
//Again somewhere in your script
ShowPlayerStaticDialog(playerid, 0);
And if you like to show a modified message just use ShowPlayerDialog or for the public just change the dialog informations with SetStaticDialog
Reply
#8

Idea is good, but dialog string limit is 4096 chars... :/ and that will be a memory waste.
Reply
#9

Quote:
Originally Posted by BigETI
Посмотреть сообщение
First of all I just made this include in a few minutes and second with this you can just show dialogs which you don't have to copy/paste all the time

Example:
Without this include:
pawn Код:
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "My Dialog", "This is a dialog.\nAll the stuff have to be shown without any changes", "OK", "");
//..Somewhere in your script
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "My Dialog", "This is a dialog.\nAll the stuff have to be shown without any changes", "OK", "");
//..Somewhere in your script
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "My Dialog", "This is a dialog.\nAll the stuff have to be shown without any changes", "OK", "");
With this include:
pawn Код:
//For example OnGameModeInit
SetStaticDialog(0, DIALOG_STYLE_MSGBOX, "My Dialog", "This is a dialog.\nAll the stuff have to be shown without any changes", "OK", "");
//Somewhere in your script
ShowPlayerStaticDialog(playerid, 0);
//Again somewhere in your script
ShowPlayerStaticDialog(playerid, 0);
//Again somewhere in your script
ShowPlayerStaticDialog(playerid, 0);
And if you like to show a modified message just use ShowPlayerDialog or for the public just change the dialog informations with SetStaticDialog
Thats nice! Now i think its usefull!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)