Dialog style? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog style? (
/showthread.php?tid=615744)
Dialog style? -
MrCallum - 26.08.2016
How do I get this custom looking Dialog?
Re: Dialog style? -
Shinja - 26.08.2016
Try \t in DIALOG_STYLE_MSGBOX
Re: Dialog style? -
MrCallum - 26.08.2016
So how would I place it in this?
Код:
CMD:wfdebt(playerid, params[])
{
if(gTeam[playerid] == 2 || IsACop(playerid)|| PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pMember] == 7)
{
new string[128], x;
foreach(Player, i)
{
if(GetPlayerCash(i) < 0)
{
format(string, sizeof(string), "%s\n%s: | %d$", string,GetPlayerNameEx(i),GetPlayerCash(i));
x++;
}
}
if(x != 0)
{
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_MSGBOX, "Current Players Wanted in Debt:", string, "Okay", "");
}
else
{
if(GetPlayerCash(playerid) > 1)
{
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_MSGBOX, "Current Players Wanted in Debt:", string, "Okay", "");
format(string, sizeof(string), "%s\nNo one is in debt!", string);
x++;
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " You're not a Cop / Debt Collectors or Government");
}
return 1;
}
Re: Dialog style? -
DarkSkull - 26.08.2016
Try this:
PHP код:
CMD:wfdebt(playerid, params[])
{
if(gTeam[playerid] == 2 || IsACop(playerid)|| PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pMember] == 7)
{
new string[128], x;
foreach(Player, i)
{
if(GetPlayerCash(i) < 0)
{
format(string, sizeof(string), "%s\n%s: \t %d$", string,GetPlayerNameEx(i),GetPlayerCash(i));
x++;
}
}
if(x != 0)
{
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_MSGBOX, "Current Players Wanted in Debt:", string, "Okay", "");
}
else
{
if(GetPlayerCash(playerid) > 1)
{
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_MSGBOX, "Current Players Wanted in Debt:", string, "Okay", "");
format(string, sizeof(string), "%s\nNo one is in debt!", string);
x++;
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " You're not a Cop / Debt Collectors or Government");
}
return 1;
}
Re: Dialog style? -
Threshold - 26.08.2016
This is a dialog style that was added in 0.3.7. It's called "DIALOG_STYLE_TABLIST". You can read more about it here:
https://sampwiki.blast.hk/wiki/Dialog_Styles
Basically, you are creating a message box that has both columns and rows. \n creates a new row, \t creates a new tab (or indentation / column).
This dialog would have looked similar to this:
PHP код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_TABLIST, "Help Center: General Help",
"{FFFF00}Command\tHelp\n\
{00FF00}/shout\t{FFFFFF}Ability to reach more persons with your character's voice\n\
{00FF00}/me\t{FFFFFF}Ability to describe your character's movements in depth\n\
etc.",
"Next", "Close");
Eventually your compiler will get angry with you when you exceed a certain length, so you're better off creating a large string and using 'strcat' for each line. Note that you cannot have more than 4 columns, so don't use more than 4 "\t"s on a single line.
An example can also be found on the Dialog Styles wiki page, with pictures included.
Re: Dialog style? -
DeeadPool - 26.08.2016
DIALOG_STYLE_TABLIST