/factions dialog
#1

Hy everyone, i`m sorry for my bed english.
Let s start with my problem. I want to do, lets say a faction sistem. I created a document to save the values.
When i type /factions i want to appear a dialog with factions and other detail listed below readed from that document. problem is that it shows me only the last row readed from the document tot the entire start from 0 to the end.(i have done the load and update "public") Maybe you understand more from pictures. Thanks

The command(ZCMD):
Code:
CMD:test(playerid, params[])
{
    if(IsPlayerConnectedEx(playerid))
    {
        new titles[40 * sizeof(FactionsInfo)];
        for(new idx = fnumber; idx < sizeof(FactionsInfo); idx ++)
        {
             format(titles, sizeof(titles), "[%d/%d] %s\n", FactionsInfo[idx][fOnlineMembers], FactionsInfo[idx][fMembersmax], FactionsInfo[idx][fName]);
        }
        ShowPlayerDialog(playerid, factionsdialog, DIALOG_STYLE_LIST, "Factions", titles, "Select", "Close");
	}
	return 1;
}
http://postimg.org/image/tbw0zp8pv/ the code from file
http://postimg.org/image/q3rjmnmg3/ how its now and how it should be.


Solved!
Reply
#2

paste the dialog "factionsdialog" and any other dialog's you've added under that dialog
Reply
#3

until now i have not added anything under that "factionsdialog", i just want to see if this first part of code its ok and then i will add other functions under that

under that factionsdialog i want to add something to do this shit) when you select one faction from the ones listed below in /factions .

http://postimg.org/image/ig2sz5x95/
Reply
#4

what did i do wrong ?
Reply
#5

Quote:
Originally Posted by crouch010
View Post
what did i do wrong ?
pawn Code:
for(new idx = fnumber; idx < sizeof(FactionsInfo); idx ++)
{
What is fnumber? Does it count the max amount of factions? If so, shouldn't it be replaced with 0? So then it counts the max amount of factions from 0 and loops correctly. Not sure if you understand.
Reply
#6

i tried also with 0, the fnumber is defined above the script like this "new fnumber = 0;" . i don't think this is the problem...i know that "i" needs to be "0" and it is, annoying problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)