03.08.2013, 21:34
Hi all, I currently on progress making GM with MySQL, but, why my GM wont updating the database?
I've made this function
As you can see, I trying to print, but its not called.
I've made this function
pawn Код:
stock ScythSaveAccount(playerid)
{
new query[10000], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
ScythSafeUpdating();
format(query, sizeof(query), "UPDATE `users` SET \
`Registered` = %d, \
`RegisterStep` = %d, \
`Gender` = %d, \
`Date1` = %d, \
`Date2` = %d, \
`Date3` = %d, \
`Age` = %d, \
`Origin` = '%s', \
`Dollars` = %d, \
`Cents` = %d, \
`Level` = %d, \
`Health` = %f, \
`Armor` = %f, \
`Clothes` = %d, \
`PosX` = %f, \
`PosY` = %f, \
`PosZ` = %f, \
`PosR` = %f,",
PlayerInfo[playerid][pRegistered],
PlayerInfo[playerid][pRegstep],
PlayerInfo[playerid][pGender],
PlayerInfo[playerid][pDate][0],
PlayerInfo[playerid][pDate][1],
PlayerInfo[playerid][pDate][2],
PlayerInfo[playerid][pAge],
ScythReturnEscaped(PlayerInfo[playerid][pOrigin]),
PlayerInfo[playerid][pDollars],
PlayerInfo[playerid][pCents],
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pHealth],
PlayerInfo[playerid][pArmor],
PlayerInfo[playerid][pClothes],
PlayerInfo[playerid][pPosX],
PlayerInfo[playerid][pPosY],
PlayerInfo[playerid][pPosZ],
PlayerInfo[playerid][pPosR]
);
format(query, sizeof(query), "%s \
`IP` = '%s', \
`VirtualWorld` = %d, \
`Interior` = %d, \
`AdminLevel` = %d, \
`Account` = %d, \
`Balance1` = %d, \
`Balance2` = %d, \
`Job` = %d, \
`Duty` = %d, \
`Salary1` = %d, \
`Salary2` = %d \
WHERE `Username` = '%s'",
query,
PlayerInfo[playerid][pIP],
PlayerInfo[playerid][pVW],
PlayerInfo[playerid][pInt],
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pAccount],
PlayerInfo[playerid][pBalance][0],
PlayerInfo[playerid][pBalance][1],
PlayerInfo[playerid][pJob],
PlayerInfo[playerid][pDuty],
PlayerInfo[playerid][pSalary][0],
PlayerInfo[playerid][pSalary][1],
Name
);
mysql_query(query);
print("called");
return 1;
}