Need help with GUI.
#1

Hello. I'm trying to make simple Dialog that it would print me properties, but it prints me only the one property which is the biggest ID. Here is a code:

new String[256];
for(new i = 0; i < MAX_PROPERTIES; i++)
{
format(String,256,"Property Owner\n\n%s %s",prop[i][Name], prop[i][OwnerName]);
}
ShowPlayerDialog(playerid,35,DIALOG_STYLE_MSGBOX," Properties", String,"Close","Close");

But when I put this in message server shows me all properties. What I do wrong? I know, that something with formating, because server doesn't creates new line. But what? Also when I print it server prints all properties. I need something to do that it would open one dialog with all properties.
Reply
#2

Just check what's the nearest property:

pawn Код:
new String[256];
for(new i = 0; i < MAX_PROPERTIES; i++)
{
if(!IsPlayerInRangeOfPoint(playerid, 3, prop[i][Xcoord], prop[i][Ycoord], prop[i][Zcoord])) continue;
format(String,256,"Property Owner\n\n%s %s",prop[i][Name], prop[i][OwnerName]);
break;
}
ShowPlayerDialog(playerid,35,DIALOG_STYLE_MSGBOX," Properties", String,"Close","Close");
Nonameman
Reply
#3

You see, I don't have to be in any property. When I type /properties server have to show me only ONE dialog with all properties names and their owners. But it shows me for each property different dialog so I just can see the last one. So how can I do that I would see one dialog with all properties?
Reply
#4

Ohh sorry, I thought u wanted to do this. W8 a little.
Reply
#5

pawn Код:
new String[256];
format(String,256,"Property Owner\n");
for(new i = 0; i < MAX_PROPERTIES; i++)
{
format(String,256,"%s\n%s %s", String, prop[i][Name], prop[i][OwnerName]);
}
ShowPlayerDialog(playerid,35,DIALOG_STYLE_MSGBOX," Properties", String,"Close","Close");
Reply
#6

Thanks.
Reply
#7

One more problem.. Can you tell how to do that all my race tracks would be in the same dialog?

new Tracks[256];
for(new i = 0; i < sInfo[MaxRaces]; i++)
{
format(Tracks,256,"%s\n", rInfo[i][Name]);
}
ShowPlayerDialog(playerid,34,DIALOG_STYLE_LIST,"Ar range race",Tracks,"Select","Back");
Reply
#8

Sure, sorry:

pawn Код:
new Tracks[256];
for(new i = 0; i < sInfo[MaxRaces]; i++)
{
format(Tracks,256,"\n%s", Tracks, rInfo[i][Name]);
}
ShowPlayerDialog(playerid,34,DIALOG_STYLE_LIST,"Ar range race",Tracks,"Select","Back");
Reply
#9

Dudes, learn to edit.

Double posting is against the rules.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)