Dialog.
#1

I had this working fine, however I modified it for multiplayer use. When a project is created, a new table is created in the database for the "ranks" what i'm trying to do is this: When you click "Open Project" it shows any projects that have your name in that table, however, it don't work.



pawn Код:
if(listitem == 1)
            {
                new string[51];
                new string1[MAX_PROJECT_LENGTH];
                for(new i; i<MAX_PROJECTS; i++)
                {
                    new Query[500];
                    format(Query, sizeof(Query), "SELECT * FROM `PROJECT_%d_RANKS` WHERE `ID` = %d", i, PlayerInfo[pid][pID]);
                    mysql_query(Query);
                    mysql_store_result();
                    if(mysql_num_rows())
                    {
                        if(i != MAX_PROJECTS-1)
                        {
                            format(string, sizeof(string), "\n%d:\t%s", i, ProjectInfo[i][prName]);
                            strcat(string1, string);
                        }
                    }
                }
               
                ShowPlayerDialog(pid, Project_Dialog, DIALOG_STYLE_LIST, "Select a project", string1, "Okay", "Cancel");
                PlayerInfo[pid][pProjects] = string1;
            }
Reply
#2

Why do it that way when you could just make a table called "projects" and put all of the info in there,

so the layout would be like:

id,
projectid,
projectname,

blablabla
Reply
#3

Quote:
Originally Posted by sammp
Посмотреть сообщение
Why do it that way when you could just make a table called "projects" and put all of the info in there,

so the layout would be like:

id,
projectid,
projectname,

blablabla
I can't think of a way to do that and save ALL accounts in there, then extract that data. I do have a table called "projects" that holds all other info. However, if say I have 4 people that are rank #1, how am I going to add that to the same table?

That isnt the issue in this case.
Reply
#4

Well you just make another row called sub and if theres someone already #1 you add a val to it
Reply
#5

It's not the saving I care about at the moment, it's checking to see if the player's name is in the project.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)