LoadBanData, oder wie auch immer du es nennen willst.
Auf jeden Fall nicht LoadPlayerData, das gibt es ja schon.
Problem mit der Speicherung der Accounts (Mysql R41-4)
- Dr. Frauenarzt
- Geschlossen
- Erledigt
Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!
Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
-
-
Vermutlich meinst du es so oder?
Code
Alles anzeigenPUBLIC:SetConnectBan(playerid) { new query[256]; mysql_format(handle, query, sizeof(query), "SELECT * FROM `bannedplayers` WHERE `Name` = '%s'", SpielerName(playerid)); mysql_pquery(handle, query, "LoadPlayerBan", "d", playerid); LoginScreen(playerid,0); LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid); format(string, 256, "Dieser Account ist gesperrt, mit ihm kann nicht gespielt werden.\n\nWenn das nicht dein Account ist Verwende einen anderen Nickname.\nWenn das dein Account ist und du zu unrecht gesperrt wurdest, melde dich im Forum unter www.coming-soon.de\n\nGrund:\t\t%s\nDauer:\t\tPermanent\nAdmin:\t\t%s", BanReason, BanHammer); ShowPlayerDialog(playerid, 45, DIALOG_STYLE_MSGBOX, "Coming Soon", string, "Abbrechen", ""); SetTimerEx("ConnectKick", 10,0,"i",playerid); } forward LoadPlayerBan(playerid); public LoadPlayerBan(playerid) { new rows, BanHammer[128], BanReason[128]; cache_get_row_count(rows); if(rows) { cache_get_value_name(0, "Reason", BanReason); cache_get_value_name(0, "Hammer", BanHammer); } return 1; }
-
Das wird so nicht kompilieren, da BanHammer und BanReason in SetConnectBan nicht deklariert sind.
Zeile 8 bis 12 müssen nach cache_get_value_name(0, "Hammer", BanHammer); eingefügt werden.
Du willst ja die Meldung nur ausgeben, wenn der Spieler gebannt ist, also wenn ein Eintrag in der Tabelle steht. Den jetziger Code würde den Spieler immer vom Server werfen.Beides hättest du aber auch durch ausprobieren herausfinden können.
-
Habe jetzt beide angepasst Timeban und Ban.
Der Log:
Code
Alles anzeigen[14:26:39] [DEBUG] mysql_format(1, 0x06AEE6E4, 123, "SELECT * FROM `bannedplayers` WHERE `Name` = '%e'") [14:26:39] [DEBUG] CHandle::EscapeString(this=0x6c87fc0, src='James.Gordon') [14:26:39] [DEBUG] CConnection::EscapeString(src='James.Gordon', this=0x276ff00, connection=0x6bfeba8) [14:26:39] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'James.Gordon' [14:26:39] [DEBUG] mysql_format: return value: '59' [14:26:39] [DEBUG] mysql_pquery(1, "SELECT * FROM `bannedplayers` WHERE `Name` = 'James.Gordon'", "", "") [14:26:39] [DEBUG] CCallback::Create(amx=0x4c330c8, name='', format='', params=0x6aee2cc, param_offset=5) [14:26:39] [DEBUG] CHandle::Execute(this=0x6c87fc0, type=2, query=0x276bec0) [14:26:39] [DEBUG] CConnectionPool::Queue(query=0x276bec0, this=0x276fbc0) [14:26:39] [DEBUG] CConnection::Execute(query=0x276bec0, this=0x72e8020, connection=0x6cf36e0) [14:26:39] [DEBUG] CQuery::Execute(this=0x276bec0, connection=0x6cf36e0) [14:26:39] [DEBUG] CHandle::Execute - return value: true [14:26:39] [DEBUG] mysql_pquery: return value: '1' [14:26:39] [DEBUG] cache_get_row_count(0x06AEE2DC) [14:26:39] [ERROR] cache_get_row_count: no active cache [14:26:39] [INFO] query "SELECT * FROM `bannedplayers` WHERE `Name` = 'James.Gordon'" successfully executed within 2.530 milliseconds [14:26:39] [DEBUG] CResultSet::Create(connection=0x6cf36e0, query_str='SELECT * FROM `bannedplayers` WHERE `Name` = 'James.Gordon'') [14:26:39] [DEBUG] created new resultset '0x6d0b0b0' [14:26:39] [DEBUG] fetched MySQL result '0x6d1f7c0' [14:26:39] [DEBUG] allocated 0 bytes for PAWN result [14:26:42] [DEBUG] mysql_format(1, 0x06AEEDFC, 256, "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = '%s'") [14:26:42] [DEBUG] mysql_format: return value: '69' [14:26:42] [DEBUG] mysql_pquery(1, "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'", "LoadPlayerData", "dd") [14:26:42] [DEBUG] CCallback::Create(amx=0x4c330c8, name='LoadPlayerData', format='dd', params=0x6aeede0, param_offset=5) [14:26:42] [DEBUG] CCallback::Create - callback index for 'LoadPlayerData': 170 [14:26:42] [DEBUG] processing specifier 'd' with parameter index 0 [14:26:42] [DEBUG] retrieved and pushed value '8' [14:26:42] [DEBUG] processing specifier 'd' with parameter index 1 [14:26:42] [DEBUG] retrieved and pushed value '1' [14:26:42] [INFO] Callback 'LoadPlayerData' set up for delayed execution. [14:26:42] [DEBUG] created delayed callback with 2 parameters [14:26:42] [DEBUG] CHandle::Execute(this=0x6c87fc0, type=2, query=0x276c418) [14:26:42] [DEBUG] CConnectionPool::Queue(query=0x276c418, this=0x276fbc0) [14:26:42] [DEBUG] CHandle::Execute - return value: true [14:26:42] [DEBUG] mysql_pquery: return value: '1' [14:26:42] [DEBUG] mysql_format(1, 0x06AEEDFC, 256, "SELECT * FROM `users` WHERE `Name`='%s'") [14:26:42] [DEBUG] CConnection::Execute(query=0x276c418, this=0x7112020, connection=0x6ce9f30) [14:26:42] [DEBUG] mysql_format: return value: '49' [14:26:42] [DEBUG] CQuery::Execute(this=0x276c418, connection=0x6ce9f30) [14:26:42] [DEBUG] mysql_pquery(1, "SELECT * FROM `users` WHERE `Name`='James.Gordon'", "PlayerHaveMD5", "d") [14:26:42] [DEBUG] CCallback::Create(amx=0x4c330c8, name='PlayerHaveMD5', format='d', params=0x6aeede4, param_offset=5) [14:26:42] [DEBUG] CCallback::Create - callback index for 'PlayerHaveMD5': 242 [14:26:42] [DEBUG] processing specifier 'd' with parameter index 0 [14:26:42] [DEBUG] retrieved and pushed value '8' [14:26:42] [INFO] Callback 'PlayerHaveMD5' set up for delayed execution. [14:26:42] [DEBUG] created delayed callback with 1 parameter [14:26:42] [DEBUG] CHandle::Execute(this=0x6c87fc0, type=2, query=0x276c2e8) [14:26:42] [DEBUG] CConnectionPool::Queue(query=0x276c2e8, this=0x276fbc0) [14:26:42] [DEBUG] CConnection::Execute(query=0x276c2e8, this=0x72e8020, connection=0x6cf36e0) [14:26:42] [DEBUG] CQuery::Execute(this=0x276c2e8, connection=0x6cf36e0) [14:26:42] [DEBUG] CHandle::Execute - return value: true [14:26:42] [DEBUG] mysql_pquery: return value: '1' [14:26:42] [INFO] query "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'" successfully executed within 59.314 milliseconds [14:26:42] [DEBUG] CResultSet::Create(connection=0x6ce9f30, query_str='SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'') [14:26:42] [DEBUG] created new resultset '0x6d0aeb8' [14:26:42] [DEBUG] fetched MySQL result '0x6d4ff90' [14:26:42] [DEBUG] allocated 20 bytes for PAWN result [14:26:42] [INFO] query "SELECT * FROM `users` WHERE `Name`='James.Gordon'" successfully executed within 59.428 milliseconds [14:26:42] [DEBUG] CResultSet::Create(connection=0x6cf36e0, query_str='SELECT * FROM `users` WHERE `Name`='James.Gordon'') [14:26:42] [DEBUG] created new resultset '0x6d0b1c8' [14:26:42] [DEBUG] fetched MySQL result '0x6d1bec8' [14:26:42] [DEBUG] allocated 0 bytes for PAWN result [14:26:42] [DEBUG] CCallback::Execute(amx=0x4c330c8, index=170, num_params=2) [14:26:42] [INFO] Executing callback 'LoadPlayerData' with 2 parameters... [14:26:42] [DEBUG] processing internal specifier 'c' [14:26:42] [DEBUG] pushed value '1' onto AMX stack [14:26:42] [DEBUG] processing internal specifier 'c' [14:26:42] [DEBUG] pushed value '8' onto AMX stack [14:26:42] [DEBUG] executing AMX callback with index '170' [14:26:42] [DEBUG] cache_get_row_count(0x06AEEFE8) [14:26:42] [DEBUG] cache_get_row_count: return value: '1' [14:26:42] [DEBUG] AMX callback executed with error '0' [14:26:42] [INFO] Callback successfully executed. [14:26:42] [DEBUG] CCallback::Execute(amx=0x4c330c8, index=242, num_params=1) [14:26:42] [INFO] Executing callback 'PlayerHaveMD5' with 1 parameter... [14:26:42] [DEBUG] processing internal specifier 'c' [14:26:42] [DEBUG] pushed value '8' onto AMX stack [14:26:42] [DEBUG] executing AMX callback with index '242' [14:26:42] [DEBUG] cache_get_row_count(0x06AEF1F8) [14:26:42] [DEBUG] cache_get_row_count: return value: '1' [14:26:42] [DEBUG] AMX callback executed with error '0' [14:26:42] [INFO] Callback successfully executed.
Komisch ist aber warum kann er sich einloggen obwohl kein Account exestiert?
Verstehe ich ggerade nicht.Die Neuen Codes:
Code
Alles anzeigen//=========================================================================================================// //=========================================================================================================// PUBLIC:SetConnectBan(playerid) { new string[128]; mysql_format(handle, string, sizeof(string), "SELECT * FROM `bannedplayers` WHERE `Name` = '%s'", SpielerName(playerid)); mysql_pquery(handle, string, "LoadPlayerBan", "d", playerid); } //=========================================================================================================// //=========================================================================================================// PUBLIC:SetConnectTimeBan(playerid) { new string[128]; mysql_format(handle, string, sizeof(string), "SELECT * FROM `bannedplayers` WHERE `Name` = '%s'", SpielerName(playerid)); mysql_pquery(handle, string, "LoadPlayerTimeBan", "d", playerid); } //=========================================================================================================// //=========================================================================================================// public LoadPlayerBan(playerid) { new rows, string[128], BanHammer[128], BanReason[128]; cache_get_row_count(rows); if(rows) { cache_get_value_name(0, "Reason", BanReason); cache_get_value_name(0, "Hammer", BanHammer); LoginScreen(playerid,0); LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid); format(string, 256, "Dieser Account ist gesperrt, mit ihm kann nicht gespielt werden.\n\nWenn das nicht dein Account ist Verwende einen anderen Nickname.\nWenn das dein Account ist und du zu unrecht gesperrt wurdest, melde dich im Forum unter www.coming-soon.de\n\nGrund:\t\t%s\nDauer:\t\tPermanent\nAdmin:\t\t%s", BanReason, BanHammer); ShowPlayerDialog(playerid, 45, DIALOG_STYLE_MSGBOX, "Coming Soon", string, "Abbrechen", ""); SetTimerEx("ConnectKick", 10,0,"i",playerid); } return 1; } //=========================================================================================================// //=========================================================================================================// public LoadPlayerTimeBan(playerid) { new rows, BPZeit, string[128], BanHammer[128], BanReason[128]; cache_get_row_count(rows); if(rows) { cache_get_value_name(0, "Reason", BanReason); cache_get_value_name(0, "Hammer", BanHammer); new _converts[4], Zeit = BPZeit-Time(); ConvertSecEx( Zeit , _converts[0] , _converts[1] , _converts[2] , _converts[3]); LoginScreen(playerid,0); LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid); format(string, 256, "Dieser Account ist gesperrt, mit ihm kann nicht gespielt werden.\n\nWenn das nicht dein Account ist Verwende einen anderen Nickname.\nWenn das dein Account ist und du zu unrecht gesperrt wurdest, melde dich im Forum unter www.coming-soon.de\n\nGrund:\t\t%s\nDauer:\t\t%d Tage, %d Stunden und %d Minuten\nAdmin:\t\t%s", BanReason, _converts[3],_converts[2],_converts[1], BanHammer); ShowPlayerDialog(playerid, 45, DIALOG_STYLE_MSGBOX, "Coming Soon", string, "Abbrechen", ""); SetTimerEx("ConnectKick", 10,0,"i",playerid); } return 1; } //=========================================================================================================// //=========================================================================================================//
-
Beim LoadPlayerData:
new count = cache_get_row_count(count);
zu:
new count;
cache_get_row_count(count); -
Diese Variante hatte ich versucht klappte auch nicht. ich weiß nicht was sein Problem ist..
Code
Alles anzeigen[14:39:06] [DEBUG] mysql_format(1, 0x069976D4, 123, "SELECT * FROM `bannedplayers` WHERE `Name` = '%e'") [14:39:06] [DEBUG] CHandle::EscapeString(this=0x6b27b60, src='James.Gordon') [14:39:06] [DEBUG] CConnection::EscapeString(src='James.Gordon', this=0x273b668, connection=0x6b77828) [14:39:06] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'James.Gordon' [14:39:06] [DEBUG] mysql_format: return value: '59' [14:39:06] [DEBUG] mysql_pquery(1, "SELECT * FROM `bannedplayers` WHERE `Name` = 'James.Gordon'", "", "") [14:39:06] [DEBUG] CCallback::Create(amx=0x4ae30c8, name='', format='', params=0x69972bc, param_offset=5) [14:39:06] [DEBUG] CHandle::Execute(this=0x6b27b60, type=2, query=0x6bc1ff0) [14:39:06] [DEBUG] CConnectionPool::Queue(query=0x6bc1ff0, this=0x273b8a8) [14:39:06] [DEBUG] CConnection::Execute(query=0x6bc1ff0, this=0x7184020, connection=0x6b9a098) [14:39:06] [DEBUG] CQuery::Execute(this=0x6bc1ff0, connection=0x6b9a098) [14:39:06] [DEBUG] CHandle::Execute - return value: true [14:39:06] [DEBUG] mysql_pquery: return value: '1' [14:39:06] [DEBUG] cache_get_row_count(0x069972CC) [14:39:06] [ERROR] cache_get_row_count: no active cache [14:39:06] [INFO] query "SELECT * FROM `bannedplayers` WHERE `Name` = 'James.Gordon'" successfully executed within 6.337 milliseconds [14:39:06] [DEBUG] CResultSet::Create(connection=0x6b9a098, query_str='SELECT * FROM `bannedplayers` WHERE `Name` = 'James.Gordon'') [14:39:06] [DEBUG] created new resultset '0x6bdcf48' [14:39:06] [DEBUG] fetched MySQL result '0x6bd80f8' [14:39:06] [DEBUG] allocated 0 bytes for PAWN result [14:39:09] [DEBUG] mysql_format(1, 0x06997DEC, 256, "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = '%s'") [14:39:09] [DEBUG] mysql_format: return value: '69' [14:39:09] [DEBUG] mysql_pquery(1, "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'", "LoadPlayerData", "dd") [14:39:09] [DEBUG] CCallback::Create(amx=0x4ae30c8, name='LoadPlayerData', format='dd', params=0x6997dd0, param_offset=5) [14:39:09] [DEBUG] CCallback::Create - callback index for 'LoadPlayerData': 170 [14:39:09] [DEBUG] processing specifier 'd' with parameter index 0 [14:39:09] [DEBUG] retrieved and pushed value '8' [14:39:09] [DEBUG] processing specifier 'd' with parameter index 1 [14:39:09] [DEBUG] retrieved and pushed value '1' [14:39:09] [INFO] Callback 'LoadPlayerData' set up for delayed execution. [14:39:09] [DEBUG] created delayed callback with 2 parameters [14:39:09] [DEBUG] CHandle::Execute(this=0x6b27b60, type=2, query=0x6bc25e0) [14:39:09] [DEBUG] CConnectionPool::Queue(query=0x6bc25e0, this=0x273b8a8) [14:39:09] [DEBUG] CConnection::Execute(query=0x6bc25e0, this=0x6fb6020, connection=0x6b90b90) [14:39:09] [DEBUG] CQuery::Execute(this=0x6bc25e0, connection=0x6b90b90) [14:39:09] [DEBUG] CHandle::Execute - return value: true [14:39:09] [DEBUG] mysql_pquery: return value: '1' [14:39:09] [DEBUG] mysql_format(1, 0x06997DEC, 256, "SELECT * FROM `users` WHERE `Name`='%s'") [14:39:09] [DEBUG] mysql_format: return value: '49' [14:39:09] [DEBUG] mysql_pquery(1, "SELECT * FROM `users` WHERE `Name`='James.Gordon'", "PlayerHaveMD5", "d") [14:39:09] [DEBUG] CCallback::Create(amx=0x4ae30c8, name='PlayerHaveMD5', format='d', params=0x6997dd4, param_offset=5) [14:39:09] [DEBUG] CCallback::Create - callback index for 'PlayerHaveMD5': 242 [14:39:09] [DEBUG] processing specifier 'd' with parameter index 0 [14:39:09] [DEBUG] retrieved and pushed value '8' [14:39:09] [INFO] Callback 'PlayerHaveMD5' set up for delayed execution. [14:39:09] [DEBUG] created delayed callback with 1 parameter [14:39:09] [DEBUG] CHandle::Execute(this=0x6b27b60, type=2, query=0x6bc2380) [14:39:09] [DEBUG] CConnectionPool::Queue(query=0x6bc2380, this=0x273b8a8) [14:39:09] [DEBUG] CHandle::Execute - return value: true [14:39:09] [DEBUG] mysql_pquery: return value: '1' [14:39:09] [DEBUG] CConnection::Execute(query=0x6bc2380, this=0x7184020, connection=0x6b9a098) [14:39:09] [DEBUG] CQuery::Execute(this=0x6bc2380, connection=0x6b9a098) [14:39:09] [INFO] query "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'" successfully executed within 1.10 milliseconds [14:39:09] [DEBUG] CResultSet::Create(connection=0x6b90b90, query_str='SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'') [14:39:09] [DEBUG] created new resultset '0x6bb6c08' [14:39:09] [DEBUG] fetched MySQL result '0x6bf8b78' [14:39:09] [DEBUG] allocated 20 bytes for PAWN result [14:39:09] [INFO] query "SELECT * FROM `users` WHERE `Name`='James.Gordon'" successfully executed within 1.482 milliseconds [14:39:09] [DEBUG] CResultSet::Create(connection=0x6b9a098, query_str='SELECT * FROM `users` WHERE `Name`='James.Gordon'') [14:39:09] [DEBUG] created new resultset '0x6bdcfb8' [14:39:09] [DEBUG] fetched MySQL result '0x271c4b8' [14:39:09] [DEBUG] allocated 0 bytes for PAWN result [14:39:09] [DEBUG] CCallback::Execute(amx=0x4ae30c8, index=170, num_params=2) [14:39:09] [INFO] Executing callback 'LoadPlayerData' with 2 parameters... [14:39:09] [DEBUG] processing internal specifier 'c' [14:39:09] [DEBUG] pushed value '1' onto AMX stack [14:39:09] [DEBUG] processing internal specifier 'c' [14:39:09] [DEBUG] pushed value '8' onto AMX stack [14:39:09] [DEBUG] executing AMX callback with index '170' [14:39:09] [DEBUG] cache_get_row_count(0x06997FD8) [14:39:09] [DEBUG] cache_get_row_count: return value: '1' [14:39:09] [DEBUG] AMX callback executed with error '0' [14:39:09] [INFO] Callback successfully executed. [14:39:09] [DEBUG] CCallback::Execute(amx=0x4ae30c8, index=242, num_params=1) [14:39:09] [INFO] Executing callback 'PlayerHaveMD5' with 1 parameter... [14:39:09] [DEBUG] processing internal specifier 'c' [14:39:09] [DEBUG] pushed value '8' onto AMX stack [14:39:09] [DEBUG] executing AMX callback with index '242' [14:39:09] [DEBUG] cache_get_row_count(0x069981E8) [14:39:09] [DEBUG] cache_get_row_count: return value: '1' [14:39:09] [DEBUG] AMX callback executed with error '0' [14:39:09] [INFO] Callback successfully executed.
Krümmel da schon lange habe alles kontrolliert sonst ist ja nichts mehr mit den Bans habe ich jetzt verändert macht auch keine Fehler mehr soweit ich das raus lesen kann. -
Dann gibt es wohl einen Eintrag für James.Gordon in der Tabelle users.
-
-
Ich sehe grade:
[14:39:09] [DEBUG] mysql_pquery(1, "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'", "LoadPlayerData", "dd")
Das Query muss geändert werden.
Zu:
SELECT * FROM `users` ...Sprich:
COUNT(*) AS `count` zu: * -
Meinst du so?
Code
Alles anzeigenpublic OnLoginCamera(playerid) { if(IsPlayerConnected(playerid)) { new query[256]; PlayerPlaySound(playerid,1185,0.0,0.0,0.0); mysql_format(handle, query, sizeof(query), "SELECT * FROM `users` WHERE `Name`='%s'", SpielerName(playerid)); mysql_pquery(handle, query, "LoadPlayerData", "dd", playerid, 1); mysql_format(handle, query, sizeof(query), "SELECT * FROM `users` WHERE `Name`='%s'", SpielerName(playerid)); mysql_pquery(handle, query, "PlayerHaveMD5", "d", playerid); } return 1; }
-
Ja. Wobei du den Code aus PlayerHaveMD5 auch bei LoadPlayerData eintragen kannst. Dann sparst du dir das zweite Query.
-
Code
Alles anzeigen[16:45:39] [DEBUG] mysql_format(1, 0x0696A82C, 256, "SELECT * FROM `users` WHERE `Name` = '%s' AND `NewPassword` ='%e'") [16:45:39] [DEBUG] CHandle::EscapeString(this=0x6af7580, src='57B87A3FFAE0CF4E1C88DDF4FAD66F890AB379D222F6D2F4B8AC4D5099E5BEA8D9797A12039E0CD0079E4BE53C56940888B504274F60B32931188CE63F8739AB') [16:45:39] [DEBUG] CConnection::EscapeString(src='57B87A3FFAE0CF4E1C88DDF4FAD66F890AB379D222F6D2F4B8AC4D5099E5BEA8D9797A12039E0CD0079E4BE53C56940888B504274F60B32931188CE63F8739AB', this=0x268c190, connection=0x6b44828) [16:45:39] [DEBUG] CHandle::EscapeString - return value: true, escaped string: '57B87A3FFAE0CF4E1C88DDF4FAD66F890AB379D222F6D2F4B8AC4D5099E5BEA8D9797A12039E0CD0079E4BE53C56940888B504274F60B32931188CE63F8739AB' [16:45:39] [DEBUG] mysql_format: return value: '201' [16:45:39] [DEBUG] mysql_pquery(1, "SELECT * FROM `users` WHERE `Name` = 'James.Gordon' AND `NewPassword` ='57B87A3FFAE0CF4E1C88DDF4FAD66F890AB379D222F6D2F4B8AC4D5099E5BEA8D9797A12039E0CD0079E4BE53C56940888B504274F60B32931188CE63F8739AB'", "LoadPlayerDataSequence", "dd") [16:45:39] [DEBUG] CCallback::Create(amx=0x4b730c8, name='LoadPlayerDataSequence', format='dd', params=0x696a60c, param_offset=5) [16:45:39] [DEBUG] CCallback::Create - callback index for 'LoadPlayerDataSequence': 170 [16:45:39] [DEBUG] processing specifier 'd' with parameter index 0 [16:45:39] [DEBUG] retrieved and pushed value '8' [16:45:39] [DEBUG] processing specifier 'd' with parameter index 1 [16:45:39] [DEBUG] retrieved and pushed value '2' [16:45:39] [INFO] Callback 'LoadPlayerDataSequence' set up for delayed execution. [16:45:39] [DEBUG] created delayed callback with 2 parameters [16:45:39] [DEBUG] CHandle::Execute(this=0x6af7580, type=2, query=0x6bb3d60) [16:45:39] [DEBUG] CConnectionPool::Queue(query=0x6bb3d60, this=0x268c450) [16:45:39] [DEBUG] CConnection::Execute(query=0x6bb3d60, this=0x7158020, connection=0x6b71618) [16:45:39] [DEBUG] CQuery::Execute(this=0x6bb3d60, connection=0x6b71618) [16:45:39] [DEBUG] CHandle::Execute - return value: true [16:45:39] [DEBUG] mysql_pquery: return value: '1' [16:45:39] [INFO] query "SELECT * FROM `users` WHERE `Name` = 'James.Gordon' AND `NewPassword` ='57B87A3FFAE0CF4E1C88DDF4FAD66F890AB379D222F6D2F4B8AC4D5099E5BEA8D9797A12039E0CD0079E4BE53C56940888B504274F60B32931188CE63F8739AB'" successfully executed within 4.490 milliseconds [16:45:39] [DEBUG] CResultSet::Create(connection=0x6b71618, query_str='SELECT * FROM `users` WHERE `Name` = 'James.Gordon' AND `NewPassword` ='57B87A3FFAE0CF4E1C88DDF4FAD66F890AB379D222F6D2F4B8AC4D5099E5BEA8D9797A12039E0CD0079E4BE53C56940888B504274F60B32931188CE63F8739AB'') [16:45:39] [DEBUG] created new resultset '0x6bbead0' [16:45:39] [DEBUG] fetched MySQL result '0x2692f08' [16:45:39] [DEBUG] allocated 0 bytes for PAWN result [16:45:39] [DEBUG] CCallback::Execute(amx=0x4b730c8, index=170, num_params=2) [16:45:39] [INFO] Executing callback 'LoadPlayerDataSequence' with 2 parameters... [16:45:39] [DEBUG] processing internal specifier 'c' [16:45:39] [DEBUG] pushed value '2' onto AMX stack [16:45:39] [DEBUG] processing internal specifier 'c' [16:45:39] [DEBUG] pushed value '8' onto AMX stack [16:45:39] [DEBUG] executing AMX callback with index '170' [16:45:39] [DEBUG] cache_get_row_count(0x0696AF68) [16:45:39] [DEBUG] cache_get_row_count: return value: '1' [16:45:39] [DEBUG] AMX callback executed with error '0' [16:45:39] [INFO] Callback successfully executed.
Habe folgendes Problem.
Wen ich mich einloggen möchte sagt er mir Falsches Passwort obwohl ich das Richtige eingebe.
//E:
Es sieht voll lange aus das Passwort irgendwie aber in der Datenbank ist das:
57B87A3FFAE0CF4E1C88DDF4FAD66F89
-
Es sieht voll lange aus das Passwort irgendwie aber in der Datenbank ist das:
Dann ist vermutlich die Spalte für das Passwort zu klein angelegt. Erhöhe die Zeichenanzahl.
-
Hab ein Problem das die Speicherung nicht wirklich funktioniert.
Laut Log wird es gepeichert abre in der Datenbank steht 0?
Code[20:03:49] `PayDayHad`='0', `CDPlayer`='0', `AlcoholPerk`='0', `PainKillerPerk`='0', `PistolSkill`='0', `MaschinePistolSkill`='0', `SturmgewehrPistolSkill`='0', `ShotGunSkill`='0', `DrugPerk`='0', `MiserPerk`='0', `TraderPerk`='0', `Tutorial`='1', `Cptut`='1', `kh`='0', `Warnings`='0', `Fuel`='0', `Married`='0', `MarriedTo`='Niemand', `WantedLevel`='0', `Spawn`='0' WHERE `Name`='James.Gordon'
Code:
Codemysql_format(handle, secondQuery, sizeof(secondQuery), "%s`TraderPerk`='%d', `Tutorial`='%d', `Cptut`='%d', `kh`='%d', `Warnings`='%d', `Fuel`='%d', `Married`='%d', `MarriedTo`='%s', `WantedLevel`='%d', `Spawn`='%d' WHERE `Name`='%s' ", secondQuery, PlayerInfo[playerid][pTraderPerk], PlayerInfo[playerid][pTut], PlayerInfo[playerid][pCPTUT], PlayerInfo[playerid][pKHTIME], PlayerInfo[playerid][pWarns], PlayerInfo[playerid][pFuel], PlayerInfo[playerid][pMarried], PlayerInfo[playerid][pMarriedTo], PlayerInfo[playerid][pWantedLevel], PlayerInfo[playerid][pSpawn], SpielerName(playerid));
Das Spuckt er per Mysql Log auf:
Code
Alles anzeigen[20:03:49] [DEBUG] mysql_format(1, 0x069D9F70, 3046, "UPDATE `users` SET `Level`='%d', `AdminLevel`='%d', `Checkpoint`='%d', `CPrison`='%d', `RunningCP`='%d', `TeamRadar`='%d', `BNDRadar`='%d', `Rolex`='%d', `Swissonic`='%d', `Casio`='%d', ") [20:03:49] [DEBUG] mysql_format: return value: '176' [20:03:49] [DEBUG] mysql_format(1, 0x069D9F70, 3046, "`Breitling`='%d', `Nixon`='%d', `IceWatch`='%d', `StartCoints`='%d', `Coints`='%d', `SpawnhealZeit`='%d', `DeaglespawnZeit`='%d', `M4SpawnZeit`='%d', `MP5SpawnZeit`='%d', `MehrZinsenZeit`='%d', ") [20:03:49] [DEBUG] mysql_format: return value: '184' [20:03:49] [DEBUG] mysql_format(1, 0x069D9F70, 3046, "`Medickit`='%d', `Startbonus`='%d', `Kreditkarte`='%d', `KreditkarteBenutzung`='%d', `Personalausweis`='%d', `Namechange`='%d', `DonateRank`='%d', `UpgradePoints`='%d', `ConnectedTime`='%d', `Registered`='%d', ") [20:03:49] [DEBUG] mysql_format: return value: '201' [20:03:49] [DEBUG] mysql_format(1, 0x069D9F70, 3046, "`Sex`='%d', `Age`='%d', `Origin`='%d', `Muted`='%d', `Respect`='%d', `Gehalt`='%d', `Money`='%d', `Bank`='%d', `Jobgeld`='%d', `Crimes`='%d', ") [20:03:49] [DEBUG] mysql_format: return value: '136' [20:03:49] [DEBUG] mysql_format(1, 0x069D9F70, 3046, "`Kills`='%d', `sKills`='%d', `Deaths`='%d', `Arrested`='%d', `ArrestTime`='%d', `PhoneBook`='%d', `LottoNr`='%d', `Fishes`='%d', `BiggestFish`='%d', `Job`='%d', ") [20:03:49] [DEBUG] mysql_format: return value: '151' [20:03:49] [DEBUG] mysql_format(1, 0x069D9F70, 3046, "`HeadValue`='%d', `Jailed`='%d', `JailTime`='%d', `Leader`='%d', `Member`='%d', `Rank`='%d', `Skin`='%d', `Vertragszeit`='%d', ") [20:03:49] [DEBUG] mysql_format: return value: '122' [20:03:49] [DEBUG] mysql_format(1, 0x069D9F70, 3046, "`NewsSkill`='%d', `House`='%d', `Mieten`='%d', `HealPaket`='%d', `ArmourPaket`='%d', `WaffenPaket`='%d', `OverHealPaket`='%d', `FishSkill`='%d', `MechSkill`='%d', `pSHealth`='%.1f', ") [20:03:49] [DEBUG] mysql_format: return value: '173' [20:03:49] [DEBUG] mysql_format(1, 0x069D9F70, 3046, "`PhoneNr`='%d', `Hotel`='%d', `Biz`='%d', `CarLic`='%d', `FlyLic`='%d', `BoatLic`='%d', `FishLic`='%d', `GunLic`='%d', `Zollpass`='%d', `GotMD5`='%d' WHERE `Name`='%s' ") [20:03:49] [DEBUG] mysql_format: return value: '170' [20:03:49] [DEBUG] mysql_pquery(1, "UPDATE `users` SET `Level`='1', `AdminLevel`='0', `Checkpoint`='0', `CPrison`='0', `RunningCP`='0', `TeamRadar`='0', `BNDRadar`='0', `Rolex`='0', `Swissonic`='0', `Casio`='0', `Breitling`='0', `Nixon`='0', `IceWatch`='0', `StartCoints`='0', `Coints`='0', `SpawnhealZeit`='0', `DeaglespawnZeit`='0', `M4SpawnZeit`='0', `MP5SpawnZeit`='0', `MehrZinsenZeit`='0', `Medickit`='0', `Startbonus`='0', `Kreditkarte`='0', `KreditkarteBenutzung`='0', `Personalausweis`='1', `Namechange`='57', `DonateRank`='0', `UpgradePoints`='0', `ConnectedTime`='0', `Registered`='1', `Sex`='1', `Age`='21', `Origin`='1', `Muted`='0', `Respect`='0', `Gehalt`='0', `Money`='4990', `Bank`='0', `Jobgeld`='0', `Crimes`='0', `Kills`='0', `sKills`='0', `Deaths`='0', `Arrested`='0', `ArrestTime`='0', `PhoneBook`='0', `LottoNr`='0', `Fishes`='0', `BiggestFish`='0', `Job`='0', `HeadValue`='0', `Jailed`='0', `JailTime`='0', `Leader`='-1', `Member`='-1', `Rank`='0', `Skin`='26', `Vertragszeit`='5', `NewsSkill`='0', `House`='0', `Mieten`='0', `HealPaket`='0', `ArmourPaket`='0', `WaffenPaket`='0', `OverHealPaket`='0', `FishSkill`='0', `MechSkill`='0', `pSHealth`='50.0', `PhoneNr`='1', `Hotel`='-1', `Biz`='-1', `CarLic`='0', `FlyLic`='0', `BoatLic`='0', `FishLic`='0', `GunLic`='0', `Zollpass`='0', `GotMD5`='1' WHERE `Name`='James.Gordon' ", "", "") [20:03:49] [DEBUG] CCallback::Create(amx=0x4af30c8, name='', format='', params=0x69d9f5c, param_offset=5) [20:03:49] [DEBUG] CHandle::Execute(this=0x6b75e18, type=2, query=0x6c1ef08) [20:03:49] [DEBUG] CConnectionPool::Queue(query=0x6c1ef08, this=0x271c3e8) [20:03:49] [DEBUG] CHandle::Execute - return value: true [20:03:49] [DEBUG] mysql_pquery: return value: '1' [20:03:49] [DEBUG] CConnection::Execute(query=0x6c1ef08, this=0x71df020, connection=0x6bf7860) [20:03:49] [DEBUG] mysql_format(1, 0x069D9F70, 3046, "UPDATE `users` SET `Gun1`='%d', `Gun2`='%d', `Gun3`='%d', `Gun4`='%d', `Ammo1`='%d', `Ammo2`='%d', `Ammo3`='%d', `Ammo4`='%d', `CarTime`='%d', `PayDay`='%d', ") [20:03:49] [DEBUG] CQuery::Execute(this=0x6c1ef08, connection=0x6bf7860) [20:03:49] [DEBUG] mysql_format: return value: '148' [20:03:49] [DEBUG] mysql_format(1, 0x069D9F70, 3046, "`PayDayHad`='%d', `CDPlayer`='%d', `AlcoholPerk`='%d', `PainKillerPerk`='%d', `PistolSkill`='%d', `MaschinePistolSkill`='%d', `SturmgewehrPistolSkill`='%d', `ShotGunSkill`='%d', `DrugPerk`='%d', `MiserPerk`='%d', ") [20:03:49] [DEBUG] mysql_format: return value: '203' [20:03:49] [DEBUG] mysql_format(1, 0x069D9F70, 3046, "%s`TraderPerk`='%d', `Tutorial`='%d', `Cptut`='%d', `kh`='%d', `Warnings`='%d', `Fuel`='%d', `Married`='%d', `MarriedTo`='%s', `WantedLevel`='%d', `Spawn`='%d' WHERE `Name`='%s' ") [20:03:49] [DEBUG] mysql_format: return value: '385' [20:03:49] [DEBUG] mysql_pquery(1, "`PayDayHad`='0', `CDPlayer`='0', `AlcoholPerk`='0', `PainKillerPerk`='0', `PistolSkill`='0', `MaschinePistolSkill`='0', `SturmgewehrPistolSkill`='0', `ShotGunSkill`='0', `DrugPerk`='0', `MiserPerk`='0', `TraderPerk`='0', `Tutorial`='1', `Cptut`='1', `kh`='0', `Warnings`='0', `Fuel`='0', `Married`='0', `MarriedTo`='Niemand', `WantedLevel`='0', `Spawn`='0' WHERE `Name`='James.Gordon' ", "", "") [20:03:49] [DEBUG] CCallback::Create(amx=0x4af30c8, name='', format='', params=0x69d9f5c, param_offset=5) [20:03:49] [DEBUG] CHandle::Execute(this=0x6b75e18, type=2, query=0x6c1efa0) [20:03:49] [DEBUG] CConnectionPool::Queue(query=0x6c1efa0, this=0x271c3e8) [20:03:49] [DEBUG] CConnection::Execute(query=0x6c1efa0, this=0x7005020, connection=0x6bee2a0) [20:03:49] [DEBUG] CQuery::Execute(this=0x6c1efa0, connection=0x6bee2a0) [20:03:49] [DEBUG] CHandle::Execute - return value: true [20:03:49] [DEBUG] mysql_pquery: return value: '1' [20:03:49] [ERROR] error #1064 while executing query "`PayDayHad`='0', `CDPlayer`='0', `AlcoholPerk`='0', `PainKillerPerk`='0', `PistolSkill`='0', `MaschinePistolSkill`='0', `SturmgewehrPistolSkill`='0', `ShotGunSkill`='0', `DrugPerk`='0', `MiserPerk`='0', `TraderPerk`='0', `Tutorial`='1', `Cptut`='1', `kh`='0', `Warnings`='0', `Fuel`='0', `Married`='0', `MarriedTo`='Niemand', `WantedLevel`='0', `Spawn`='0' WHERE `Name`='James.Gordon' ": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`PayDayHad`='0', `CDPlayer`='0', `AlcoholPerk`='0', `PainKillerPerk`='0', `Pisto' at line 1 [20:03:49] [DEBUG] CConnection::GetError(this=0x7005020, connection=0x6bee2a0) [20:03:49] [INFO] query "UPDATE `users` SET `Level`='1', `AdminLevel`='0', `Checkpoint`='0', `CPrison`='0', `RunningCP`='0', `TeamRadar`='0', `BNDRadar`='0', `Rolex`='0', `Swissonic`='0', `Casio`='0', `Breitling`='0', `Nixon`='0', `IceWatch`='0', `StartCoints`='0', `Coints`='0', `SpawnhealZeit`='0', `DeaglespawnZeit`='0', `M4SpawnZeit`='0', `MP5SpawnZeit`='0', `MehrZinsenZeit`='0', `Medickit`='0', `Startbonus`='0', `Kreditkarte`='0', `KreditkarteBenutzung`='0', `Personalausweis`='1', `Namechange`='57', `DonateRank`='0', `UpgradePoints`='0', `ConnectedTime`='0', `Registered`='1', `Sex`='1', `Age`='21', `Origin`='1', `Muted`='0', `Respect`='0', `Gehalt`='0', `Money`='4990', `Bank`='0', `Jobgeld`='0', `Crimes`='0', `Kills`='0', `sKills`='0', `Deaths`='0', `Arrested`='0', `ArrestTime`='0', `PhoneBook`='0', `LottoNr`='0', `Fishes`='0', `BiggestFish`='0', `Job`='0', `HeadValue`='0', `Jailed`='0', `JailTime`='0', `Leader`='-1', `Member`='-1', `Rank`='0', `Skin`='26', `Vertragszeit`='5', `NewsSkill`='0', `House`='0', `Mieten`='0', `HealPaket`='0', `ArmourPaket`='0', `WaffenPaket`='0', `OverHealPaket`='0', `FishSkill`='0', `MechSkill`='0', `pSHealth`='50.0', `PhoneNr`='1', `Hotel`='-1', `Biz`='-1', `CarLic`='0', `FlyLic`='0', `BoatLic`='0', `FishLic`='0', `GunLic`='0', `Zollpass`='0', `GotMD5`='1' WHERE `Name`='James.Gordon' " successfully executed within 62.704 milliseconds [20:03:49] [DEBUG] CResultSet::Create(connection=0x6bf7860, query_str='UPDATE `users` SET `Level`='1', `AdminLevel`='0', `Checkpoint`='0', `CPrison`='0', `RunningCP`='0', `TeamRadar`='0', `BNDRadar`='0', `Rolex`='0', `Swissonic`='0', `Casio`='0', `Breitling`='0', `Nixon`='0', `IceWatch`='0', `StartCoints`='0', `Coints`='0', `SpawnhealZeit`='0', `DeaglespawnZeit`='0', `M4SpawnZeit`='0', `MP5SpawnZeit`='0', `MehrZinsenZeit`='0', `Medickit`='0', `Startbonus`='0', `Kreditkarte`='0', `KreditkarteBenutzung`='0', `Personalausweis`='1', `Namechange`='57', `DonateRank`='0', `UpgradePoints`='0', `ConnectedTime`='0', `Registered`='1', `Sex`='1', `Age`='21', `Origin`='1', `Muted`='0', `Respect`='0', `Gehalt`='0', `Money`='4990', `Bank`='0', `Jobgeld`='0', `Crimes`='0', `Kills`='0', `sKills`='0', `Deaths`='0', `Arrested`='0', `ArrestTime`='0', `PhoneBook`='0', `LottoNr`='0', `Fishes`='0', `BiggestFish`='0', `Job`='0', `HeadValue`='0', `Jailed`='0', `JailTime`='0', `Leader`='-1', `Member`='-1', `Rank`='0', `Skin`='26', `Vertragszeit`='5', `NewsSkill`='0', `House`='0', `Mieten`='0', `HealPaket`='0', `ArmourPaket`='0', `WaffenPaket`='0', `OverHealPaket`='0', `FishSkill`='0', `MechSkill`='0', `pSHealth`='50.0', `PhoneNr`='1', `Hotel`='-1', `Biz`='-1', `CarLic`='0', `FlyLic`='0', `BoatLic`='0', `FishLic`='0', `GunLic`='0', `Zollpass`='0', `GotMD5`='1' WHERE `Name`='James.Gordon' ') [20:03:49] [DEBUG] created new resultset '0x6c1e3d8' [20:03:49] [DEBUG] fetched MySQL result '0x0' [20:03:49] [DEBUG] CCallback::Create(amx=0x4af30c8, name='OnQueryError', format='dsssd) [20:03:49] [DEBUG] CCallback::Create - callback index for 'OnQueryError': -10047 [20:03:49] [DEBUG] processing specifier 'd' [20:03:49] [DEBUG] retrieved and pushed value '1064' [20:03:49] [DEBUG] processing specifier 's' [20:03:49] [DEBUG] retrieved and pushed value 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`PayDayHad`='0', `CDPlayer`='0', `AlcoholPerk`='0', `PainKillerPerk`='0', `Pisto' at line 1' [20:03:49] [DEBUG] processing specifier 's' [20:03:49] [DEBUG] retrieved and pushed value '' [20:03:49] [DEBUG] processing specifier 's' [20:03:49] [DEBUG] retrieved and pushed value '`PayDayHad`='0', `CDPlayer`='0', `AlcoholPerk`='0', `PainKillerPerk`='0', `PistolSkill`='0', `MaschinePistolSkill`='0', `SturmgewehrPistolSkill`='0', `ShotGunSkill`='0', `DrugPerk`='0', `MiserPerk`='0', `TraderPerk`='0', `Tutorial`='1', `Cptut`='1', `kh`='0', `Warnings`='0', `Fuel`='0', `Married`='0', `MarriedTo`='Niemand', `WantedLevel`='0', `Spawn`='0' WHERE `Name`='James.Gordon' ' [20:03:49] [DEBUG] processing specifier 'd' [20:03:49] [DEBUG] retrieved and pushed value '1' [20:03:49] [INFO] Callback 'OnQueryError' set up for delayed execution. [20:03:49] [DEBUG] created delayed callback with 5 parameters [20:03:49] [DEBUG] CCallback::Execute(amx=0x4af30c8, index=-10047, num_params=5) [20:03:49] [INFO] Executing callback 'c‹9' with 5 parameters... [20:03:49] [DEBUG] processing internal specifier 'c' [20:03:49] [DEBUG] pushed value '1' onto AMX stack [20:03:49] [DEBUG] processing internal specifier 's' [20:03:49] [DEBUG] pushed value '`PayDayHad`='0', `CDPlayer`='0', `AlcoholPerk`='0', `PainKillerPerk`='0', `PistolSkill`='0', `MaschinePistolSkill`='0', `SturmgewehrPistolSkill`='0', `ShotGunSkill`='0', `DrugPerk`='0', `MiserPerk`='0', `TraderPerk`='0', `Tutorial`='1', `Cptut`='1', `kh`='0', `Warnings`='0', `Fuel`='0', `Married`='0', `MarriedTo`='Niemand', `WantedLevel`='0', `Spawn`='0' WHERE `Name`='James.Gordon' ' onto AMX stack [20:03:49] [DEBUG] processing internal specifier 's' [20:03:49] [DEBUG] pushed value '' onto AMX stack [20:03:49] [DEBUG] processing internal specifier 's' [20:03:49] [DEBUG] pushed value 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`PayDayHad`='0', `CDPlayer`='0', `AlcoholPerk`='0', `PainKillerPerk`='0', `Pisto' at line 1' onto AMX stack [20:03:49] [DEBUG] processing internal specifier 'c' [20:03:49] [DEBUG] pushed value '1064' onto AMX stack [20:03:49] [DEBUG] executing AMX callback with index '-10047' [20:03:49] [DEBUG] AMX callback executed with error '0' [20:03:49] [INFO] Callback successfully executed.
-
[ERROR] error #1064 while executing query "`PayDayHad`='0', `CDPlayer`='0', `AlcoholPerk`='0', `PainKillerPerk`='0', `PistolSkill`='0', `MaschinePistolSkill`='0', `SturmgewehrPistolSkill`='0', `ShotGunSkill`='0', `DrugPerk`='0', `MiserPerk`='0', `TraderPerk`='0', `Tutorial`='1', `Cptut`='1', `kh`='0', `Warnings`='0', `Fuel`='0', `Married`='0', `MarriedTo`='Niemand', `WantedLevel`='0', `Spawn`='0' WHERE `Name`='James.Gordon' ": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`PayDayHad`='0', `CDPlayer`='0', `AlcoholPerk`='0', `PainKillerPerk`='0', `Pisto' at line 1
Der Anfang des Queries fehlt, heißt der vorherige Teil wird nicht angefügt.
Der Code den du gepostet hast passt nicht zum Log.
-
OK,
Verstehe nicht wieso der das nicht so wirklich alles übernimmt....
Habe mir extra Zeit gelassen und alles sauber ausgearbeitet und geschrieben.Code
Alles anzeigenPUBLIC:PlayerUpdate(playerid) { new mainQuery[3046], secondQuery[3046]; if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)) { mysql_format(handle, secondQuery, sizeof(secondQuery), "UPDATE `users` SET `Level`='%d', `AdminLevel`='%d', `Checkpoint`='%d', `CPrison`='%d', `RunningCP`='%d', `TeamRadar`='%d', `BNDRadar`='%d', `Rolex`='%d', `Swissonic`='%d', `Casio`='%d', ", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pAdmin], CCP[playerid], xPrison[playerid], RunningCP[playerid], TeamRadar[playerid], BNDRadar[playerid], PlayerInfo[playerid][pRolex], PlayerInfo[playerid][pSwissonic], PlayerInfo[playerid][pCasio]); strcat(mainQuery, secondQuery); mysql_format(handle, secondQuery, sizeof(secondQuery), "`Breitling`='%d', `Nixon`='%d', `IceWatch`='%d', `StartCoints`='%d', `Coints`='%d', `SpawnhealZeit`='%d', `DeaglespawnZeit`='%d', `M4SpawnZeit`='%d', `MP5SpawnZeit`='%d', `MehrZinsenZeit`='%d', ", PlayerInfo[playerid][pBreitling], PlayerInfo[playerid][pNixon], PlayerInfo[playerid][pIceWatch], PlayerInfo[playerid][pStartCoints], PlayerInfo[playerid][pCoints], PlayerInfo[playerid][pSpawnhealZeit], PlayerInfo[playerid][pDeaglespawnZeit], PlayerInfo[playerid][pM4SpawnZeit], PlayerInfo[playerid][pMP5SpawnZeit], PlayerInfo[playerid][pMehrZinsenZeit]); strcat(mainQuery, secondQuery); mysql_format(handle, secondQuery, sizeof(secondQuery), "`Medickit`='%d', `Startbonus`='%d', `Kreditkarte`='%d', `KreditkarteBenutzung`='%d', `Personalausweis`='%d', `Namechange`='%d', `DonateRank`='%d', `UpgradePoints`='%d', `ConnectedTime`='%d', `Registered`='%d', ", PlayerInfo[playerid][pMedickit], PlayerInfo[playerid][pStartbonus], PlayerInfo[playerid][pKreditkarte], PlayerInfo[playerid][pKreditkartebenutzen], PlayerInfo[playerid][pPersonalausweis], PlayerInfo[playerid][pSchongeandert], PlayerInfo[playerid][pDonatorRank], PlayerInfo[playerid][gPupgrade], PlayerInfo[playerid][pConnectTime], PlayerInfo[playerid][pReg]); strcat(mainQuery, secondQuery); mysql_format(handle, secondQuery, sizeof(secondQuery), "`Sex`='%d', `Age`='%d', `Origin`='%d', `Muted`='%d', `Respect`='%d', `Gehalt`='%d', `Money`='%d', `Bank`='%d', `Jobgeld`='%d', `Crimes`='%d', ", PlayerInfo[playerid][pSex], PlayerInfo[playerid][pAlter], PlayerInfo[playerid][pOrigin], PlayerInfo[playerid][pMuted], PlayerInfo[playerid][pRespekt], PlayerInfo[playerid][pGehalt], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pBank], PlayerInfo[playerid][pJobLohn], PlayerInfo[playerid][pCrimes]); strcat(mainQuery, secondQuery); mysql_format(handle, secondQuery, sizeof(secondQuery), "`Kills`='%d', `sKills`='%d', `Deaths`='%d', `Arrested`='%d', `ArrestTime`='%d', `PhoneBook`='%d', `LottoNr`='%d', `Fishes`='%d', `BiggestFish`='%d', `Job`='%d', ", PlayerInfo[playerid][pKills], PlayerInfo[playerid][psKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pArrested], PlayerInfo[playerid][pArrestTime], PlayerInfo[playerid][pPhoneBook], PlayerInfo[playerid][pLottoNr], PlayerInfo[playerid][pFishes], PlayerInfo[playerid][pBiggestFish], PlayerInfo[playerid][pJob]); strcat(mainQuery, secondQuery); mysql_format(handle, secondQuery, sizeof(secondQuery), "`HeadValue`='%d', `Jailed`='%d', `JailTime`='%d', `Leader`='%d', `Member`='%d', `Rank`='%d', `Skin`='%d', `Vertragszeit`='%d', ", PlayerInfo[playerid][pHeadValue], PlayerInfo[playerid][pJailed], PlayerInfo[playerid][pJailTime], PlayerInfo[playerid][pLeader], PlayerInfo[playerid][pMember], PlayerInfo[playerid][pRank], PlayerInfo[playerid][pChar], PlayerInfo[playerid][pVertragszeit]); strcat(mainQuery, secondQuery); mysql_format(handle, secondQuery, sizeof(secondQuery), "`NewsSkill`='%d', `House`='%d', `Mieten`='%d', `HealPaket`='%d', `ArmourPaket`='%d', `WaffenPaket`='%d', `OverHealPaket`='%d', `FishSkill`='%d', `MechSkill`='%d', `pSHealth`='%.1f', ", PlayerInfo[playerid][pNewsSkill], PlayerInfo[playerid][pHaus], PlayerInfo[playerid][pMieten], PlayerInfo[playerid][pHealPaket], PlayerInfo[playerid][pArmourPaket], PlayerInfo[playerid][pWaffenPaket], PlayerInfo[playerid][pOverHealPaket], PlayerInfo[playerid][pFishSkill], PlayerInfo[playerid][pMechSkill], PlayerInfo[playerid][pSHealth]); strcat(mainQuery, secondQuery); mysql_format(handle, secondQuery, sizeof(secondQuery), "`PhoneNr`='%d', `Hotel`='%d', `Biz`='%d', `CarLic`='%d', `FlyLic`='%d', `BoatLic`='%d', `FishLic`='%d', `GunLic`='%d', `Zollpass`='%d', `GotMD5`='%d' WHERE `Name`='%s' ", PlayerInfo[playerid][pNummer], PlayerInfo[playerid][pPhotelkey], PlayerInfo[playerid][pBizKey], PlayerInfo[playerid][pCarLic], PlayerInfo[playerid][pFlyLic], PlayerInfo[playerid][pBoatLic], PlayerInfo[playerid][pFishLic], PlayerInfo[playerid][pGunLic], PlayerInfo[playerid][pZollpass], GotMD5[playerid], SpielerName(playerid)); strcat(mainQuery, secondQuery); mysql_pquery(handle, mainQuery, "", ""); //print(mainQuery); strdel(mainQuery, 0, sizeof(mainQuery)); strdel(secondQuery, 0, sizeof(secondQuery)); mysql_format(handle, secondQuery, sizeof(secondQuery), "UPDATE `users` SET `Gun1`='%d', `Gun2`='%d', `Gun3`='%d', `Gun4`='%d', `Ammo1`='%d', `Ammo2`='%d', `Ammo3`='%d', `Ammo4`='%d', `CarTime`='%d', `PayDay`='%d', ", PlayerInfo[playerid][pGun1], PlayerInfo[playerid][pGun2], PlayerInfo[playerid][pGun3], PlayerInfo[playerid][pGun4], PlayerInfo[playerid][pAmmo1], PlayerInfo[playerid][pAmmo2], PlayerInfo[playerid][pAmmo3], PlayerInfo[playerid][pAmmo4], PlayerInfo[playerid][pCarTime], PlayerInfo[playerid][pPayDay]); mysql_format(handle, secondQuery, sizeof(secondQuery), "`PayDayHad`='%d', `CDPlayer`='%d', `AlcoholPerk`='%d', `PainKillerPerk`='%d', `PistolSkill`='%d', `MaschinePistolSkill`='%d', `SturmgewehrPistolSkill`='%d', `ShotGunSkill`='%d', `DrugPerk`='%d', `MiserPerk`='%d', ", PlayerInfo[playerid][pPayDayHad], PlayerInfo[playerid][pCDPlayer], PlayerInfo[playerid][pAlcoholPerk], PlayerInfo[playerid][pPainKillerPerk], PlayerInfo[playerid][pPistolSkill], PlayerInfo[playerid][pMaschinePistolSkill], PlayerInfo[playerid][pSturmgewehrPistolSkill], PlayerInfo[playerid][pShotGunSkill], PlayerInfo[playerid][pDrugPerk], PlayerInfo[playerid][pMiserPerk]); mysql_format(handle, secondQuery, sizeof(secondQuery), "%s`TraderPerk`='%d', `Tutorial`='%d', `Cptut`='%d', `kh`='%d', `Warnings`='%d', `Fuel`='%d', `Married`='%d', `MarriedTo`='%s', `WantedLevel`='%d', `Spawn`='%d' WHERE `Name`='%s' ", secondQuery, PlayerInfo[playerid][pTraderPerk], PlayerInfo[playerid][pTut], PlayerInfo[playerid][pCPTUT], PlayerInfo[playerid][pKHTIME], PlayerInfo[playerid][pWarns], PlayerInfo[playerid][pFuel], PlayerInfo[playerid][pMarried], PlayerInfo[playerid][pMarriedTo], PlayerInfo[playerid][pWantedLevel], PlayerInfo[playerid][pSpawn], SpielerName(playerid)); mysql_pquery(handle, secondQuery, "", ""); print(secondQuery); strdel(mainQuery, 0, sizeof(mainQuery)); strdel(secondQuery, 0, sizeof(secondQuery)); } return 1; }
-
mysql_format(handle, secondQuery, sizeof(secondQuery), "`PayDayHad`='%d', `CDPlayer`='%d', `AlcoholPerk`='%d', `PainKillerPerk`='%d', `PistolSkill`='%d', `MaschinePistolSkill`='%d', `SturmgewehrPistolSkill`='%d', `ShotGunSkill`='%d', `DrugPerk`='%d', `MiserPerk`='%d', ",
PlayerInfo[playerid][pPayDayHad], PlayerInfo[playerid][pCDPlayer], PlayerInfo[playerid][pAlcoholPerk], PlayerInfo[playerid][pPainKillerPerk], PlayerInfo[playerid][pPistolSkill],
PlayerInfo[playerid][pMaschinePistolSkill], PlayerInfo[playerid][pSturmgewehrPistolSkill], PlayerInfo[playerid][pShotGunSkill], PlayerInfo[playerid][pDrugPerk], PlayerInfo[playerid][pMiserPerk]);
zu:
mysql_format(handle, secondQuery, sizeof(secondQuery), "%s`PayDayHad`='%d', `CDPlayer`='%d', `AlcoholPerk`='%d', `PainKillerPerk`='%d', `PistolSkill`='%d', `MaschinePistolSkill`='%d', `SturmgewehrPistolSkill`='%d', `ShotGunSkill`='%d', `DrugPerk`='%d', `MiserPerk`='%d', ", secondQuery
PlayerInfo[playerid][pPayDayHad], PlayerInfo[playerid][pCDPlayer], PlayerInfo[playerid][pAlcoholPerk], PlayerInfo[playerid][pPainKillerPerk], PlayerInfo[playerid][pPistolSkill],
PlayerInfo[playerid][pMaschinePistolSkill], PlayerInfo[playerid][pSturmgewehrPistolSkill], PlayerInfo[playerid][pShotGunSkill], PlayerInfo[playerid][pDrugPerk], PlayerInfo[playerid][pMiserPerk]);Exakt den gleichen Fehler hattest du auch in Zeile 57 schon.
-
Kurze Frage Login/Register Funktioniert einwandfrei jetzt habe das soweit sogut jetzt hin bekommen.
Aber wen der Sich regestriert wird der case 3 nicht abgerufen? warum
-
mach mal im case 3 am ende vor der letzten
}
print("Ich werde aufgerufen....");bzw vor dem
if(PlayerInfo[playerid][pLevel] < 0) -
Der Teil sollte nach Der Regestration auftreten.
Code
Alles anzeigencase 2: { new count; cache_get_row_count(count); if(count) { new query[64+MAX_PLAYER_NAME+1]; mysql_format(handle, query, sizeof(query), "SELECT * FROM `users` WHERE `Name` = '%s'", SpielerName(playerid)); mysql_pquery(handle, query, "LoadPlayerDataSequence", "dd", playerid, 3); print("Ich werde aufgerufen...."); } else { pPassAttempt[playerid] ++; if(pPassAttempt[playerid] >= 3) { SendClientMessage(playerid, COLOR_WHITE, "{9AB3D0}Du wurdest vom Server gekickt, da du dein Passwort zu oft falsch eingegeben hast."); Kick(playerid); return 1; } ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Coming Soon", "{FFEE00}Falsches Passwort\n\n{FFFFFF}Willkommen auf "SERVER_NAME"\n\nDein Account wurde in der Datenbank gefunden.\nGib dein Passwort niemals weiter. Auch nicht an Admins oder Supporter!\nDu kannst dich nun einloggen. Bitte gib dein Passwort ein:","OK"," "); return 1; } }
Aber es passiert danach garnichts..
Relogge ich funktioniert alles.
Aber man sollte ja nicht jedes mal Reloggen das es weiter geht.OnDialogResponse:
Code
Alles anzeigenelse if(dialogid == DIALOG_REGISTER) { if(response) { if(strlen(inputtext) < 6) { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Coming Soon", "{FFFFFF}Das Passwort muss mindestens eine Länge von 6 Zeichen haben.\n\nWillkommen auf "SERVER_NAME"\n\nDein Account wurde in der Datenbank gefunden.\nGib dein Passwort niemals weiter. Auch nicht an Admins oder Supporter!\nDu kannst dich nun einloggen. Bitte gib dein Passwort ein:","Erstellen",""); return 1; } new query[256]; new wHash[129]; WP_Hash(wHash, sizeof(wHash), inputtext); mysql_format(handle, query, sizeof(query), "INSERT INTO `users` (`Name`, `NewPassword`) VALUES ('%s', '%e')", SpielerName(playerid), wHash); mysql_pquery(handle, query); PlayerPlaySound(playerid, 1188, 0.0, 0.0, 0.0); OnPlayerRegister(playerid); } if(!response) { Kick(playerid); return 1; } } else if(dialogid == DIALOG_LOGIN) { if(response) { if(!strlen(inputtext)) { pPassAttempt[playerid] ++; if(pPassAttempt[playerid] >= 3) { SendClientMessage(playerid, COLOR_WHITE, "{9AB3D0}Du wurdest vom Server gekickt, da du dein Passwort zu oft falsch eingegeben hast."); Kick(playerid); return 1; } ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Coming Soon", "{FFEE00}Falsches Passwort\n\n{FFFFFF}Willkommen auf "SERVER_NAME"\n\nDein Account wurde in der Datenbank gefunden.\nGib dein Passwort niemals weiter. Auch nicht an Admins oder Supporter!\nDu kannst dich nun einloggen. Bitte gib dein Passwort ein:","OK"," "); return 1; } new query[256]; if(GotMD5[playerid] == 0){ mysql_format(handle, query, sizeof(query), "SELECT * FROM `users` WHERE `Name` = '%s' AND `Password` = MD5('%s')", SpielerName(playerid), inputtext); mysql_pquery(handle, query, "LoadPlayerDataSequence", "dd", playerid, 2); }else{ new wHash[129]; WP_Hash(wHash, sizeof(wHash), inputtext); mysql_format(handle, query, sizeof(query), "SELECT * FROM `users` WHERE `Name` = '%s' AND `NewPassword` ='%e'", SpielerName(playerid), wHash); mysql_pquery(handle, query, "LoadPlayerDataSequence", "dd", playerid, 2); } } if(!response) { Kick(playerid); return 1; } return 1; }
//E:Für normalerweiße regestrieren geht die schleife weiter und zeigt das Login fenster an aber das macht er ja nicht.