vendredi 15 juillet 2016

MySQL

Hi, for some reason this code doesn't work properly. All the other things work except level, admin, tester and donator. The problem is that it always says in the dialog that my level is 0 and that i'm not an admin, not a tester and not a donator. Here's the code:

Code:

                        cache_get_data(rows, fields, g_iHandle);

                        if (rows)
                        {
                            static
                                characterinfo[256],
                                birthdate[16],
                                origin[32],
                                level,
                                admin,
                                tester,
                                donator;

                                cache_get_field_content(0, "Birthdate", birthdate, g_iHandle);
                                cache_get_field_content(0, "Origin", origin, g_iHandle);
                                level = cache_get_field_int(0, "Level");
                                admin = cache_get_field_int(0, "Admin");
                                tester = cache_get_field_int(0, "Tester");
                                donator = cache_get_field_int(0, "Donator");
                                
                                if (!strlen(birthdate)) {
                                    birthdate = "Not Specified";
                                }
                                if (!strlen(origin)) {
                                    origin = "Not Specified";
                                }
                                format(characterinfo, sizeof(characterinfo), "Name: %s\nBirthdate: %s\nOrigin: %s\nCreated: %s\nPlayed: %s", PlayerCharacters[extraid][PlayerData[extraid][pCharacter] - 1], birthdate, origin, GetDuration(gettime() - cache_get_field_int(0, "CreateDate")), GetDuration(gettime() - cache_get_field_int(0, "LastLogin")));
                                format(characterinfo, sizeof(characterinfo), "%s\nLevel: %d\nAdmin: %s\nTester: %s\nDonator: %s", characterinfo, level, (admin) ? ("Yes") : ("No"), (tester) ? ("Yes") : ("No"), (donator) ? ("Yes") : ("No"));
                                Dialog_Show(extraid, ViewCharacter, DIALOG_STYLE_MSGBOX, "View Character", characterinfo, "Spawn", "Back");
                          }
What's wrong with it?

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.
Recommended article from FiveFilters.org: Most Labour MPs in the UK Are Revolting.



MySQL

Aucun commentaire:

Enregistrer un commentaire