createVote()
{
for (new i;i<4;i++) gVoteItems[i] = "RESET";
DestroyMenu(voteMenu);
voteMenu = CreateMenu("Vote",1, 50.0, 200.0, 120.0, 250.0);
print("Creating Votemenu");
for (new i=0;i<4;i++)
{
randomRaceName(i,gRaces);
AddMenuItem(voteMenu,0,gVoteItems[i]); // HOW TO USE THIS IS DIALOG ??
printf("VoteOption%d: %s",i,gVoteItems[i]);
}
for (new i=0;i<4;i++)gVotes[i]=0;
}
new pmsg[128];
format(pmsg,256,"%s %s");
ShowPlayerDialog(i, tdialog, DIALOG_STYLE_LIST, "Racing vote",gVoteItems[i],gVoteItems[i], "Vote", "");
ShowPlayerDialog(playerid,1,2,"Racing vote",gVoteItems[i],gVoteItems[i],"Vote","");
Not good.
1 race show out of 4 ![]() AddMenu: This is a good, just i need a dialog ![]() |
#define MAX_RACING_MAPS 4 //You can define here yourself the amount of racing maps you own.
#define VOTEMAP_DIALOGID 1 //You should change it if you are using another dialogs with the same ID.
stock createVote()
{
new dstr[512], bool:check = false;
for (new i = 0; i < MAX_RACING_MAPS; i++)
{
if(!check)
{
format(dstr, sizeof(dstr), "%s", gVoteItems[i]);
check = true;
}
else format(dstr, sizeof(dstr), "%s\r\n%s", dstr, gVoteItems[i]);
}
ShowPlayerDialog(playerid, VOTEMAP_DIALOGID, DIALOG_STYLE_LIST, "Racing Vote", dstr, "Vote", "Cancel");
}
for (new i;i<4;i++) gVoteItems[i] = "RESET";
stock createVote()
{
for (new i;i<4;i++) gVoteItems[i] = "RESET";
new dstr[256], bool:check = false;
// for (new i;i<4;i++) gVoteItems[i] = "RESET";
for (new i = 0; i < MAX_RACING_MAPS; i++)
{
if(!check)
{
randomRaceName(i,gRaces);
format(dstr, sizeof(dstr), "%s", gVoteItems[i]);
check = true;
}
else format(dstr, sizeof(dstr), "%s\r\n%s", dstr, gVoteItems[i]);
}
for (new i=0;i<4;i++)gVotes[i]=0;
for(new i=0;i<MAX_PLAYERS;i++)
{
ShowPlayerDialog(i, VOTEMAP_DIALOGID, DIALOG_STYLE_LIST, "Racing Vote", dstr, "Vote", "Cancel");
}
}
If not added
pawn Код:
else ![]() |