MYSQL problem... +rep -
the problem is when someone register all save but when the player spawn will die it's like it's load 0 in health
pawn Код:
LoadPlayer(playerid)
{
SetPlayerPos(playerid, pInfo[playerid][posX], pInfo[playerid][posY], pInfo[playerid][posZ]);
SetPlayerSkin(playerid, pInfo[playerid][SkinID]);//Let's set their money
GivePlayerWeapon(playerid, pInfo[playerid][WeaponSlot1], pInfo[playerid][WepSlotAmmo1]);
GivePlayerWeapon(playerid, pInfo[playerid][WeaponSlot2], pInfo[playerid][WepSlotAmmo2]);
GivePlayerWeapon(playerid, pInfo[playerid][WeaponSlot3], pInfo[playerid][WepSlotAmmo3]);
GivePlayerWeapon(playerid, pInfo[playerid][WeaponSlot4], pInfo[playerid][WepSlotAmmo4]);
GivePlayerWeapon(playerid, pInfo[playerid][WeaponSlot5], pInfo[playerid][WepSlotAmmo5]);
SetPlayerHealth(playerid, pInfo[playerid][Health]);
SetPlayerArmour(playerid, pInfo[playerid][Armour]);
}
pawn Код:
SavePlayer(playerid)
{
new query[3000], Float:pos[3], gslot[5], aslot[5], Float: health, Float: armour;
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerWeaponData(playerid, 2, gslot[0], aslot[0]);
GetPlayerWeaponData(playerid, 3, gslot[1], aslot[1]);
GetPlayerWeaponData(playerid, 4, gslot[2], aslot[2]);
GetPlayerWeaponData(playerid, 5, gslot[3], aslot[3]);
GetPlayerWeaponData(playerid, 6, gslot[4], aslot[4]);
GetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armour);
mysql_format(mysql, query, sizeof(query),
"UPDATE `players` SET \
`Admin`=%d, \
`VIP`=%d, \
`Money`=%d, \
`Materials`=%d, \
`Helper`=%d, \
`PlayHours`=%d, \
`PlayMinutes`=%d, \
`Paycheck`=%d, \
`Bank`=%d, \
`Job`=%d, \
`Packages`=%d, \
`SkinID`=%d, \
`PhoneNumber`=%d, \
`Health`=%f, \
`Armour`=%f, \
`WeaponSlot1`=%d, \
`WepSlotAmmo1`=%d, \
`WeaponSlot2`=%d, \
`WepSlotAmmo2`=%d, \
`WeaponSlot3`=%d, \
`WepSlotAmmo3`=%d, \
`WeaponSlot4`=%d, \
`WepSlotAmmo4`=%d, \
`WeaponSlot5`=%d, \
`WepSlotAmmo5`=%d, \
`posX`=%f, \
`posY`=%f, \
`posZ`=%f \
WHERE `ID`=%d",
pInfo[playerid][Admin],
pInfo[playerid][VIP],
GetPlayerMoney(playerid),
pInfo[playerid][Materials],
pInfo[playerid][Helper],
pInfo[playerid][PlayHours],
pInfo[playerid][PlayMinutes],
pInfo[playerid][Paycheck],
pInfo[playerid][Bank],
pInfo[playerid][Job],
pInfo[playerid][Packages],
GetPlayerSkin(playerid),
pInfo[playerid][PhoneNumber],
health,
armour,
gslot[0],
aslot[0],
gslot[1],
aslot[1],
gslot[2],
aslot[2],
gslot[3],
aslot[3],
gslot[4],
aslot[4],
pos[0],
pos[1],
pos[2],
pInfo[playerid][ID]);
mysql_tquery(mysql, query, "", "");
}
Re: MYSQL problem... +rep -
Re: MYSQL problem... +rep -
Might be saving a wrong value in this.
Please show your SavePlayer(playerid) function so we can see if it saves correctly.
Re: MYSQL problem... +rep -