12.01.2016, 12:20
My code:
Help me.Sorry my bad english.
PHP код:
SavePlayer(playerid)
{
new query[3000], date[6], gslot[5], aslot[5], Float: health, Float: armour, string[20], Float:PosX, Float:PosY, Float:PosZ, Float:PosA;
if(Logged[playerid])
{
GetPlayerPos(playerid,PosX,PosY,PosZ);
GetPlayerFacingAngle(playerid,PosA);
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]);
getdate(date[0], date[1], date[2]);
gettime(date[3], date[4], date[5]);
GetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armour);
format(string, sizeof(string), "%d/%d/%d %d:%d:%d", date[0], date[1], date[2], date[3], date[4], date[5]); // last login date
//////////////////////////////Thong Tin Co Ban//////////////////////////////////
mysql_format(mysql, query, sizeof(query), "UPDATE `taikhoan` SET `Admin`=%d, `SkinID`=%d, `AccountLocked`=%d, `AccountBanned`=%d, `BanningAdmin`='%s', `BannedReason`='%s', `Tien`=%d, `TienBank`=%d, `Health`=%f, `Armour`=%f, `LastActivity`='%s' WHERE `ID`=%d",
Player[playerid][Admin], GetPlayerSkin(playerid), Player[playerid][AccountLocked], Player[playerid][AccountBanned], Player[playerid][BanningAdmin], Player[playerid][BannedReason], GetPlayerMoney(playerid), Player[playerid][TienBank], health, armour, string, Player[playerid][ID]); // Updating the table
////////////////////////////////////Positions///////////////////////////////////
mysql_format(mysql, query, sizeof(query), "UPDATE `taikhoan` SET `PosX`=%f, `PosY`=%f, `PosZ`=%f, `PosA`=%f WHERE `ID`=%d",\
PosX, PosY, PosZ, PosA, Player[playerid][ID]);
////////////////////////////////////Weapons/////////////////////////////////////
mysql_format(mysql, query, sizeof(query), "UPDATE `taikhoan` SET `WeaponSlot1`=%d, `WepSlotAmmo1`=%d, `WeaponSlot2`=%d, `WepSlotAmmo2`=%d, `WeaponSlot3`=%d, `WepSlotAmmo3`=%d, `WeaponSlot4`=%d, `WepSlotAmmo4`=%d, `WeaponSlot5`=%d, `WepSlotAmmo5`=%d WHERE `ID`=%d",
gslot[0], aslot[0], gslot[1], aslot[1], gslot[2], aslot[2], gslot[3], aslot[3], gslot[4], aslot[4], Player[playerid][ID]); // Updating the table
mysql_tquery(mysql, query, "", ""); // Execute the query
}
return 1;
}