06.05.2013, 19:21
Hello, So today I have started working with Mysql and I understand it for a big part now but I still can't figure out why It doesn't save all of the things I want it to save.
I don't get any error codes or anything but it does not save: LastIP, Health, Armour, LastOn, Skin.
I use BlueG R7's MySql.
pawn Code:
enum PlayerStats
{
UserID,
Username[MAX_PLAYER_NAME],
Password[129],
LastIP[25],
Adminlevel,
Money,
RegTime,
LastOn,
Level,
Gender[7],
Age,
Float: Health,
Float: Armour,
Skin,
}
stock SaveVariables(playerid)
{
if(Authenticated[playerid])
{
new
query[9999],
Float:pFloatValue[2];//don't forget to change the "2" to "5" when enabling the last pos
GetPlayerHealth(playerid, pFloatValue[0]);
GetPlayerArmour(playerid, pFloatValue[1]);
//GetPlayerPos(playerid, pFloatValue[2], pFloatValue[3], pFloatValue[4]);
format(query, sizeof(query), "UPDATE `Accounts` SET `adminLevel` = %d, `Money` = %d, `Level` = %d,`LastOn` = %d, `Health` = %f, `Armour` = %f, `Skin` = %d' `Gender` = '%s', `LastIP` = %s AND `Age` = %d WHERE `Username` = '%s'",
Player[playerid][Adminlevel],
real_GetPlayerCash(playerid),
Player[playerid][Level],
gettime(),
pFloatValue[0],
pFloatValue[1],
Player[playerid][Skin],
Player[playerid][Gender],
PlayerIP[playerid],
Player[playerid][Age],
GetName(playerid));
mysql_function_query(connectionHandle, query, false, "DefaultCallback", "");
}
return 1;
}
I use BlueG R7's MySql.