01.12.2009, 19:31
Alright, now it prints as 0. Thank you for clearing that small bit up for me and explaining it.
let me give some more code:
heres the player info enum:
this conforms to the mysql table structure, every thing w/o a set value/length is an integer in the mysql table. ex: loggedin
and here is the loading part of the Loadplayerinfo command
Now i just came up with an idea, make a new array that list the table fields, and for each field, select the value of it (after mysql_fetch_row) and then say format(Players[playerid][field],256,"%s",fieldvalue); would that work?
let me give some more code:
heres the player info enum:
Код:
enum pInfo { username[28], password[32], email[50], hideemail, datejoined[28], id, loggedin, score, money, bankstate, adminlevel, regular, armyaccess, robrank, lastseen[10], dlicense, plicense, dinstructor, pinstructor, bannedby[28], bantime[20], banreason[128] }; new Players[MAX_PLAYERS][pInfo];
and here is the loading part of the Loadplayerinfo command
Код:
... samp_mysql_strtok(field, "|", line); format(Players[playerid][pInfo:fval],256,"%s",field); printf("%s is now stored as %s for player id (%i).",field,Players[playerid][pInfo:fval],playerid); fval ++; while(samp_mysql_strtok(field, "|", "")==1) { //Players[playerid][pInfo:fval] = format(Players[playerid][pInfo:fval],256,"%s",field); printf("%s is now stored as %s for player id (%i).",field,Players[playerid][pInfo:fval],playerid); fval ++; } ...