SA-MP Forums Archive
/factions dialog - 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: /factions dialog (/showthread.php?tid=505302)



/factions dialog - crouch010 - 07.04.2014

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!


Re: /factions dialog - Guest9328472398472 - 07.04.2014

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


Re: /factions dialog - crouch010 - 07.04.2014

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/


Re: /factions dialog - crouch010 - 07.04.2014

what did i do wrong ?


Re: /factions dialog - Stevolas - 07.04.2014

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.


Re: /factions dialog - crouch010 - 07.04.2014

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