11.11.2013, 14:59
FIxed it I had to put three ddd here if(sscanf(resultline, "p<|>fffdddddddffddddddds[16]",
I have added this three Warnings,FailLogin,RconAttempt and it doesn't load properly.
On in-game I tried to test RconAttempt I do /rcon login 1234 to make rcon attempt failed then I checked my /stats and I saw my Rcon Attempt is 1 (It means it successfully write). So I try to leave the game coz I want to check if this will load or not. Then I came back ingame then after I do /stats it shows Rcon Attempt: 48 but I only tried once. What could be the problem?
and same with Warnings even I didn't touch it it writes 48
on my /stats
Quote:
[19:49:37] sscanf warning: String buffer overflow. [19:49:37] sscanf warning: Format specifier does not match parameter count. [19:50:01] [part] test has left the server (0:1) [19:50:01] 2013, Lost connection to MySQL server during query, OnQueryFinish, UPDATE `account` SET `XPos` = -2571.57, `YPos` = 328.51, `ZPos` = 10.56, `AdminLevel` = 0, `VIPLevel` = 47, `WantedLevel` = 0, `Kills` = 0, `Deaths` = 0, `Money` = 4000, `Score` = 0, `Health` = 100.00, `Armour` = 0.00, `Hours` = 0, `Minutes` = 1, `Seconds` = 17, `LastSkin` = 0, `KickCount` = 0, `SpawnCount` = 2, `ReportCount` = 0, `Warnings` = 48, `FailLogin` = 0, `RconAttempt` = 49 WHERE `PlayerName` = 'test', 1 |
Код HTML:
stock SavePlayer(playerid) { new h, m, s, Float:health, Float:armour, Float:POS[3]; TotalGameTime(playerid, h, m, s); GetPlayerPos(playerid, POS[0], POS[1], POS[2]); GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armour); #if USE_MYSQL == true new query[789]; format(query, sizeof(query), "UPDATE `"#MYSQL_TABLE"` SET `XPos` = %.2f, `YPos` = %.2f, `ZPos` = %.2f, `AdminLevel` = %d, `VIPLevel` = %d, `WantedLevel` = %d, \ `Kills` = %d, `Deaths` = %d, `Money` = %d, `Score` = %d, `Health` = %.2f, `Armour` = %.2f, `Hours` = %d, `Minutes` = %d, `Seconds` = %d, `LastSkin` = %d, `KickCount` = %d, `SpawnCount` = %d, `ReportCount` = %d, `Warnings` = %d, `FailLogin` = %d, `RconAttempt` = %d \ WHERE `PlayerName` = '%s'", POS[0], POS[1], POS[2], PlayerInfo[playerid][AdminLevel], PlayerInfo[playerid][VIPLevel], GetPlayerWantedLevel(playerid), PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], GetPlayerMoney(playerid), GetPlayerScore(playerid), health, armour, h, m, s, PlayerInfo[playerid][LastSkin], PlayerInfo[playerid][KickCount], PlayerInfo[playerid][SpawnCount], PlayerInfo[playerid][ReportCount], PlayerInfo[playerid][Warnings], PlayerInfo[playerid][FailLogin], PlayerInfo[playerid][RconAttempt], GetName(playerid));
Код HTML:
case _THREAD_LOAD_PLAYER :
{
mysql_store_result();
if(mysql_num_rows(gSQL) > 0)
{
new resultline[512], score, money, wanted;
mysql_fetch_row_format(resultline);
if(sscanf(resultline, "p<|>fffdddddddffddddddds[16]",
PlayerInfo[extraid][XPos],
PlayerInfo[extraid][YPos],
PlayerInfo[extraid][ZPos],
PlayerInfo[extraid][AdminLevel],
PlayerInfo[extraid][VIPLevel],
wanted,
PlayerInfo[extraid][Kills],
PlayerInfo[extraid][Deaths],
money,
score,
PlayerInfo[extraid][Health],
PlayerInfo[extraid][Armour],
PlayerInfo[extraid][Hours],
PlayerInfo[extraid][Minutes],
PlayerInfo[extraid][Seconds],
PlayerInfo[extraid][KickCount],
PlayerInfo[extraid][LastSkin],
PlayerInfo[extraid][SpawnCount],
PlayerInfo[extraid][ReportCount],
PlayerInfo[extraid][Warnings],
PlayerInfo[extraid][FailLogin],
PlayerInfo[extraid][RconAttempt],
PlayerInfo[extraid][RegDate]))
{
SendClientMessage(extraid, ORANGE, "There was a problem while loading your account");
KickEx(extraid);
mysql_free_result();
return 1;
}
Код:
stock LoadPlayer(playerid) { #if LOAD_PLAYER_POS == true SetPVarInt(playerid, "1stSpawn", 1); #endif #if USE_MYSQL == true new query[634]; format(query,sizeof(query),"SELECT `XPos`,`YPos`,`ZPos`,`AdminLevel`,`VIPLevel`,`WantedLevel`,`Kills`,`Deaths`,`Money`,`Score`,`Health`,`Armour`,`Hours`,`Minutes`,`Seconds`,`KickCount`,`LastSkin`,`SpawnCount`,`ReportCount`,`Warnings`,`FailLogin`,`RconAttempt`,`RegDate` FROM `"#MYSQL_TABLE"` WHERE `PlayerName` = '%s'", GetName(playerid)); if(mysql_ping(gSQL)) { mysql_query(query, _THREAD_LOAD_PLAYER, playerid, gSQL); }
On in-game I tried to test RconAttempt I do /rcon login 1234 to make rcon attempt failed then I checked my /stats and I saw my Rcon Attempt is 1 (It means it successfully write). So I try to leave the game coz I want to check if this will load or not. Then I came back ingame then after I do /stats it shows Rcon Attempt: 48 but I only tried once. What could be the problem?
and same with Warnings even I didn't touch it it writes 48
Код HTML:
(Warnings: 48)