Dialog not displaying - 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 not displaying (
/showthread.php?tid=606887)
Dialog not displaying -
Lajko1 - 10.05.2016
Why this dialog isn't displayed?
Код:
YCMD:event(playerid,params[],help)
{
new list[256];
if(HasVoted[playerid] == 0)
{
format(list, sizeof(list), "{8585C2}Terrorists vs Counter Terrorists [TDM]\t %d Votes\n{8585C2}Protect the car [TDM]\n{8585C2}I the Conquer[DM]\n",EventVoteType[0]);
ShowPlayerDialog(playerid, DIALOG_EVENTVOTE, DIALOG_STYLE_LIST, "{0080FF}Vote for event type",list, "Next", "Exit");
}
else
{
format(list, sizeof(list), "{8585C2}Terrorists vs Counter Terrorists [TDM]\t %d Votes\n{8585C2}Protect the car [TDM]\n{8585C2}I the Conquer[DM]\n",EventVoteType[0]);
ShowPlayerDialog(playerid, DIALOG_EVENTRESULT, DIALOG_STYLE_MSGBOX, "{0080FF}Event Voting Results",list, "Ok", "Exit");
}
return 1;
}
Re: Dialog not displaying -
Dayrion - 10.05.2016
Hello.
I don't know why this isn't working with this way (tested on my gamemode):
PHP код:
new HasVoted[MAX_PLAYERS];
YCMD:event(playerid,params[], help)
{
new list[256];
if(HasVoted[playerid] == 0)
{
format(list, sizeof(list), "{8585C2}Terrorists vs Counter Terrorists [TDM]\t %d Votes\n{8585C2}Protect the car [TDM]\n{8585C2}I the Conquer[DM]\n",PlayerInfo[playerid][pAdminlvl]);
ShowPlayerDialog(playerid, 24525, DIALOG_STYLE_LIST, "{0080FF}Vote for event type",list, "Next", "Exit");
}
else
{
format(list, sizeof(list), "{8585C2}Terrorists vs Counter Terrorists [TDM]\t %d Votes\n{8585C2}Protect the car [TDM]\n{8585C2}I the Conquer[DM]\n",PlayerInfo[playerid][pAdminlvl]);
ShowPlayerDialog(playerid, 24254, DIALOG_STYLE_MSGBOX, "{0080FF}Event Voting Results",list, "Ok", "Exit");
}
return 1;
}
but this way is working .. :
PHP код:
new HasVoted[MAX_PLAYERS];
CMD:event(playerid,params[])
{
new list[256];
if(HasVoted[playerid] == 0)
{
format(list, sizeof(list), "{8585C2}Terrorists vs Counter Terrorists [TDM]\t %d Votes\n{8585C2}Protect the car [TDM]\n{8585C2}I the Conquer[DM]\n",EventVoteType[0]);
ShowPlayerDialog(playerid, DIALOG_EVENTRESULT, DIALOG_STYLE_LIST, "{0080FF}Vote for event type",list, "Next", "Exit");
}
else
{
format(list, sizeof(list), "{8585C2}Terrorists vs Counter Terrorists [TDM]\t %d Votes\n{8585C2}Protect the car [TDM]\n{8585C2}I the Conquer[DM]\n",EventVoteType[0]);
ShowPlayerDialog(playerid, DIALOG_EVENTRESULT, DIALOG_STYLE_MSGBOX, "{0080FF}Event Voting Results",list, "Ok", "Exit");
}
return 1;
}