MySQL saving problem -
SoulLedger - 21.02.2014
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.
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);
}
}
If you need anything else like logs etc. please ask politely
Re: MySQL saving problem -
Brandon_More - 21.02.2014
Debug.txt?
Re: MySQL saving problem -
FilesMAker - 21.02.2014
I miss registring Name, maybe it's the problem !
Name is not used !
Re: MySQL saving problem -
SoulLedger - 21.02.2014
I don't know hot to get the debug.txt and at FilesMaker what do you mean?
Re: MySQL saving problem -
Brandon_More - 21.02.2014
Add:
On to the callback:
Re: MySQL saving problem -
FilesMAker - 21.02.2014
Just forget I'm not skilled on SQL
You are not using Name String that all :
Код:
new Query[500], this -- > name[MAX_PLAYER_NAME] < -- is not used;
Re: MySQL saving problem -
SoulLedger - 21.02.2014
@Brandon when I add that it says undefined name, and At Files, it does not work.
Re: MySQL saving problem -
SoulLedger - 21.02.2014
Can anyone help me? Please!
Re: MySQL saving problem -
SoulLedger - 21.02.2014
Please I need someone to help me!!
Re: MySQL saving problem -
venomlivno8 - 21.02.2014
What MySQL version you are using?