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"); }
Its cache_get_field_content_int not cache_get_field_int
Rest seems fine. See in DB if you are actually admin/donator in DB. |
Nope, it's cache_get_field_int, I tried it with cache_get_field_content, I get errors when compiling. I don't need text from there, but the number.
|
He said cache_get_field_content_int, which is used to fetch the integer value. Which version of plugin are you using? I don't think there's such function as cache_get_field_int exist, unless either it was added in the latest version or your script has it re-defined.
Anyway, check your log and print the output of donator, admin and tester. |
Well, I am not quite sure about the function you have since I'm seeing the "cache_get_field_int" for the first time. I've been using the one that the guy posted earlier.
If the code compiled fine without errors/warnings then the function is obviously what you have right now. As I said, try printing the output of those statuses and also check mysql log. I am guessing there might be an error related to the field name/rows. |
How to print the output? If you meant something with printf then I printed the level, admin, tester and donator and they are all 0.
EDIT: I checked he MySQL log and it says fields "Level", "Admin", "Tester" and "Donator" are not found, but they do exist... |