SA-MP Forums Archive
Need help with GUI. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with GUI. (/showthread.php?tid=169597)



Need help with GUI. - DyDy - 20.08.2010

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.


Re: Need help with GUI. - Nonameman - 20.08.2010

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


Re: Need help with GUI. - DyDy - 20.08.2010

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?


Re: Need help with GUI. - Nonameman - 20.08.2010

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


Re: Need help with GUI. - Nonameman - 20.08.2010

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");



Re: Need help with GUI. - DyDy - 20.08.2010

Thanks.


Re: Need help with GUI. - DyDy - 20.08.2010

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");


Re: Need help with GUI. - Nonameman - 20.08.2010

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");



Re: Need help with GUI. - Cameltoe - 20.08.2010

Dudes, learn to edit.

Double posting is against the rules.