public OnPlayerDisconnect(playerid, reason)
{
new
Query[ 200 ], // We need to create such a query so we can format it.
year,month,day
;
getdate(year,month,day);
if(pInfo[playerid][USER_LOGGED_IN] == true)
{
format(Query, sizeof(Query), "UPDATE `users` SET Money = '%d', Score = '%d', EXP = '%d', Kills = '%d', Deaths = '%d', Wanted = '%d', JailTime = '%d', Job = '%d', Fstyle = '%d', PlaceHit = '%d', C4 = '%d', tie = '%d', BC = '%d', BP = '%d', Cutie = '%d', Dia = '%02d', Mes = '%02d', Ano = '%d', IP = '%s' WHERE `Username` = '%s' COLLATE NOCASE",
GetPlayerMonez(playerid),
GetPlayerScore(playerid),
pInfo[playerid][EXP],
pInfo[playerid][Kills],
pInfo[playerid][Deaths],
pInfo[playerid][Wanted],
pInfo[playerid][JailTime],
pInfo[playerid][Job],
pInfo[playerid][FStyle],
pInfo[playerid][Placehit],
pInfo[playerid][C4],
pInfo[playerid][Tie],
pInfo[playerid][BreakC],
pInfo[playerid][BreakP],
pInfo[playerid][Cutie],
day,
month,
year,
pInfo[playerid][Uip],
DB_Escape(GetPlayerName(playerid))); // Gather the name of the player then escape it.
// querying the formatted Query
db_query(Database, Query);
// We're going to reset this variable to false.
pInfo[playerid][USER_LOGGED_IN] = false;
}
return 1;
}
if(db_query(Database, Query))
{
print("Yes");
}
else
{
print("No");
}
#define DB_QUERY_ERRORS true
#include <sqlitei>
Get SQLite Improved and enable error checking.
https://sampforum.blast.hk/showthread.php?tid=303682 Put this at top of your script pawn Код:
https://github.com/Zeex/amx_assembly The problem right now however is your query size is 200 when the string length is much greater than that. |
top? fatal error 111: user error: amx_assembly is required for DB_QUERY_ERRORS. Get it here: github.com/zeex/amx_assembly
|
Yes you need the library then you will be good to go any query errors will show up for you in Windows the real nice thing about is it will tell you exactly where the problem.
|
Cant you read ?
Just do what is written... Download amx_assembly from github.com/zeex/amx_assembly |
sorry sorry, ready!
SQLitei Error: (db_query) near " ": syntax error |