0 - DIALOG_STYLE_MSGBOX 1 - DIALOG_STYLE_INPUT 2 - DIALOG_STYLE_LIST
{FFFFFF}White {F3FF02}Yellow {FFAF00}Orange {F81414}Red {0049FF}Blue {B700FF}Purple {00FFEE}Cyan {6EF83C}Green {0E0101}Black Or go to to make your own colour<<<@!1!@>>>
playerid The ID of the player to show the dialog to.
dialogid An ID to assign this dialog to, so responses can be processed. Max dialogid is 32767. Using negative values will close any open dialog.
style The style of the dialog.
caption[] The title at the top of the dialog. The length of the caption can not exceed more than 64 characters before it starts to cut off.
info[] The text to display in the dialog. Use \n to start a new line and \t to tabulate.
button1[] The text on the left button.
button2[] The text on the right button. Leave it blank to hide it.
Returns This function doesn't return a specific value
if (strcmp("/dialog", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Type something here","This is dialog test.\nSecond Line\nThird line\n{FFAF00}Orange colour", "Cancel", "Continue"); return 1;
}
if (strcmp("/sdialog", cmdtext, true, 10) == 0)
{
new HugeString[1024];
format(HugeString, sizeof(HugeString), "{FFFFFF}White Colour\n{F3FF02}Yellow Colour\n{F81414}Red Colour\n ");
format(HugeString, sizeof(HugeString), "%s{0049FF}Blue Colour\n{B700FF}Purple colour\n{00FFEE}Cyan Colour\n{6EF83C}Green Colour \n{FFC0CB}Pink Colour\n{0E0101}Black Colour", HugeString);
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_MSGBOX, "Dialog Streamer", HugeString, "OK", "");
return 1;
}
playerid The ID of the player who responded to the dialog box.
dialogid The ID of the dialog the player responded to, assigned in ShowPlayerDialog.
response 1 for first button and 0 for second button
listitem The ID of the list item selected by the player.
inputtext[] The text entered into the input box by the player or the selected list item text.
if (strcmp("/dweapons", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{00FFEE}Select weapon","{F3FF02}Sawn-Off\n{F81414}Minigun\n{0049FF}RPG\n{B700FF}Dildo\n{6EF83C}Flowers\n{FFC0CB}Desert Eagle","OK","Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(!response) return SendClientMessage(playerid, 0xFF0000FF, "You canceled!");
}
if(listitem == 0)
{
GivePlayerWeapon(playerid,26,500);
SendClientMessage(playerid,0xFFFFFFFF,"You recivied a Sawn-Off Shotgun");
return 1;
}
if(listitem == 1)
{
GivePlayerWeapon(playerid,38,500);
SendClientMessage(playerid,0xFFFFFFFF,"You recivied a Minigun");
return 1;
}
if(listitem == 2)
{
GivePlayerWeapon(playerid,35,500);
SendClientMessage(playerid,0xFFFFFFFF,"You recivied a RPG");
return 1;
}
if(listitem == 3)
{
GivePlayerWeapon(playerid,10,500);
SendClientMessage(playerid,0xFFFFFFFF,"You recivied a Dildo");
return 1;
}
if(listitem == 4)
{
GivePlayerWeapon(playerid,14,500);
SendClientMessage(playerid,0xFFFFFFFF,"You recivied Flowers");
return 1;
}
if(listitem == 5)
{
GivePlayerWeapon(playerid,24,500);
SendClientMessage(playerid,0xFFFFFFFF,"You recivied a Desert Eagle");
return 1;
}
return 0;
}
You will always need to start from "if(listitem == 0)" |
switch(listitem)
{
case 0: //Do something
case 1: //Do something
case 2: //Do something
// Etc
default: //None of the cases above
}
if(listitem == 0) //Do something
if(listitem == 1) //Do something
if(listitem == 2) //Do something
// Etc
if(listitem != 0 && listitem != 1 && listitem != 2) // None of the cases above
Register/login sistem by Kwarde http://forum.sa-mp.com/showthread.ph...OG_STYLE_INPUT |
Wrong. You can start with 'if(listitem == 1)' or 'if(listitem == 5)'. It doesn't matter with what you start.
Also, you can use: pawn Code:
pawn Code:
Eh that's not a register/login system. That are "dialog tips" But this is a nice tutorial though |