09.04.2013, 19:13
Hello, when I have make a table for an enum for my script how do I then load the variables from the mysql table to then use to script commands and such, hope this made scene.
enum PLAYER_VARIABLES
{
pDataID, // we use database ID's (data ID) as it's easier to handle than a username and provides easy table linking
pPassword[129], // passwords are hashed, the hash is 128 + 1 for the null terminator, equaling 129
pAdmin,
pCash,
pSavings,
pBankAccount,
pLevel,
pKills,
pDeaths,
pRegTime, // registration time/date; saved as a timestamp
pLastOn, // last time/date online; saved as a timestamp
Float:pHealth,
Float:pArmour,
Float:pLastX, // on the last disconnect, this was the X position of the player
Float:pLastY, // on the last disconnect, this was the Y position of the player
Float:pLastZ, // on the last disconnect, this was the Z position of the player
pSkin,
pGender[7],
pAge,
};
new pInfo[MAX_PLAYERS][PLAYER_VARIABLES]; // this allows usage of the "pInfo" variable with the "PLAYER_VARIABLES" enumerator
new szString[128];
format(szString, sizeof(szString), "Your admin level is: %d", pInfo[playerid][pAdmin]);
SendClientMessage(playerid, -1, szString);