21.02.2014, 11:00
Hey guys,
I am currently working on a RP script from scratch and I have been testing it time to time, I only just noticed that the script is not saving anything into the database.. It creates the users just fine, but its saving the users its having problems with..
Below is the codes I have for it to save the players info and stats.
If you need anything else like logs etc. please ask politely
I am currently working on a RP script from scratch and I have been testing it time to time, I only just noticed that the script is not saving anything into the database.. It creates the users just fine, but its saving the users its having problems with..
Below is the codes I have for it to save the players info and stats.
pawn Код:
SavePlayer(playerid)
{
if(PlayerInfo[playerid][Logged] == 1)
{
new Query[500], name[MAX_PLAYER_NAME];
GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
PlayerInfo[playerid][pAge] = GetPlayerSkin(playerid);
format(Query, 500, "UPDATE `playerdata` SET `admin` = '%d', `age` = '%d', `gender` = '%d',`level` = '%d', `exp` = %d, `money` = '%d', `kills` = '%d', `deaths` = '%d', `faction` = '%d', `rank` = '%d', `division` = '%d', `interior` = '%i', `world` = '%i', `x` = '%f', `y` = '%f', `z` = '%f', `a` = '%f', `skin` = '%d', `gang` = '%d', `grank` = '%d', `license` = '%d', `cdl` = '%d', `weplic` = '%d' WHERE `id` = '%d' LIMIT 1",
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pAge],
PlayerInfo[playerid][pGender],
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pExp],
PlayerInfo[playerid][pMoney],
PlayerInfo[playerid][pKills],
PlayerInfo[playerid][pDeaths],
PlayerInfo[playerid][pFaction],
PlayerInfo[playerid][pRank],
PlayerInfo[playerid][pDivision],
PlayerInfo[playerid][pInterior],
PlayerInfo[playerid][pWorld],
PlayerInfo[playerid][pX],
PlayerInfo[playerid][pY],
PlayerInfo[playerid][pZ],
PlayerInfo[playerid][pA],
PlayerInfo[playerid][pSkin],
PlayerInfo[playerid][pGang],
PlayerInfo[playerid][gRank],
PlayerInfo[playerid][pLicense],
PlayerInfo[playerid][pCDL],
PlayerInfo[playerid][pWepLic],
PlayerInfo[playerid][ID]);
mysql_query(Query);
}
}