Das p in Zeile 338 ist klein, dein Callbackname hat aber ein großes p. Das wird vermutlich der Fehler sein
[SAMMELTHREAD] Kleine Scripting Fragen
- Rafelder
- Unerledigt
Dein Problem konnte durch einen User gelöst werden? Bedank dich bei ihm indem du seinen Beitrag als Hilfreich markierst sowie einen Daumen oben dalässt
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
-
-
Das p in Zeile 338 ist klein, dein Callbackname hat aber ein großes p. Das wird vermutlich der Fehler sein
entschuldige aber habe nicht so verstanden.
Code
Alles anzeigen//new alterabfrage=strval(inputtext); if(strval(inputtext)>=18 && strval(inputtext) <=48) { pInfo[playerid][pAlter]=strval(inputtext); pInfo[playerid][pEingeloggt]=1; pInfo[playerid][pNeuling]=1; new query [256],passworteingabe[128]; GetPVarString(playerid,"passwortvar",passworteingabe,128); mysql_format(Handle, query, sizeof(query), "INSERT INTO user (Username, Passwort) VALUES ('%e',MD5('%e'))",Spielername(playerid),passworteingabe); mysql_function_query(Handle,query,true,"OnplayerRegister","i",playerid); printf("%s",query); }
ich hatte das so getestet
Code
Alles anzeigen//new alterabfrage=strval(inputtext); if(strval(inputtext)>=18 && strval(inputtext) <=48) { pInfo[playerid][pAlter]=strval(inputtext); pInfo[playerid][pEingeloggt]=1; pInfo[playerid][pNeuling]=1; new query [256],passworteingabe[128]; GetPVarString(playerid,"Passwortvar",passworteingabe,128); mysql_format(Handle, query, sizeof(query), "INSERT INTO user (Username, Passwort) VALUES ('%e',MD5('%e'))",Spielername(playerid),passworteingabe); mysql_function_query(Handle,query,true,"OnplayerRegister","i",playerid); printf("%s",query);
aber bring auch nix.
-
Das p in Zeile 338 ist klein, dein Callbackname hat aber ein großes p. Das wird vermutlich der Fehler sein
entschuldige aber habe nicht so verstanden.
mysql_function_query(Handle,query,true,"OnplayerRegister","i",playerid);
Die Funktion heißt OnPlayerRegister mit einem großen P, also musst du dies hier auch mit einem großem P aufrufen.
mysql_function_query(Handle,query,true,"OnPlayerRegister","i",playerid);
-
mysql_function_query(Handle,query,true,"OnplayerRegister","i",playerid);
Die Funktion heißt OnPlayerRegister mit einem großen P, also musst du dies hier auch mit einem großem P aufrufen.
mysql_function_query(Handle,query,true,"OnPlayerRegister","i",playerid);
danke aber hat der liebe @kyara geholfen über discord,und genau der fehler war das.
-
Beitrag von jdm_guy ()
Dieser Beitrag wurde vom Autor gelöscht (). -
Wie kann ich denn, wenn man zB einen Job startet, ihn in 3 zufällige folgende schritte unterteilen? Also angenommen man soll bäume fällen, jetzt wird man nach /work zufällig in einen von 3 oder mehr bereichen geschickt?
-
Wie kann ich denn, wenn man zB einen Job startet, ihn in 3 zufällige folgende schritte unterteilen? Also angenommen man soll bäume fällen, jetzt wird man nach /work zufällig in einen von 3 oder mehr bereichen geschickt?
Damit generierst du random eine Zahl, und den Rest kannst du ja wahrscheinlich selber
-
Hey,
Gibt es ein Anti Laufscript was man Serverseitig Blockieren kann?
-
-
https://forum.sa-mp.com/showthread.php?t=341545
Zu deiner Frage: Das muss in eine Schleife. MAX_PLAYERS ist nur eine Konstante, die die maximale Anzahl der Spieler auf dem Server beinhaltet (im Standard 500).
Außerdem musst du die Stunden auch auf 0 setzen, wenn diese über die 23 hinaus gehen (24 = 0).
-
-
guten morgen,ich habe der problem das ich nicht einlogen kann und mein leben auf 0 ist. registieren geht ohne problemaber mit einlogen nicht.
script
C
Alles anzeigen#include <a_samp> #include <a_mysql> #include <md5> //MYSL DATEN #define MYSQL_HOST "127.0.0.1" #define MYSQL_USER "root" #define MYSQL_DATA "selfmade" #define MYSQL_PASS "" new Handle; enum playerInfo{ db_id, pEingeloggt, pNeuling, pAlter, pGeschlecht, pSkin, Float:pRussi, Float:pLeben }; new pInfo[MAX_PLAYERS][playerInfo]; //DIALOGE #define DIALOG_REGISTER 1 #define DIALOG_CHAR1 2 #define DIALOG_CHAR2 3 #define DIALOG_CHAR3 4 #define DIALOG_LOGIN 5 #define DIALOG_LOGINT 6 //Farben #define geld 0xFFFF00FF #define weiss 0xFFFFFFFF //news new Logintest[MAX_PLAYERS]; main() { print("\n----------------------------------"); print(" selfmade by kevin"); print("----------------------------------\n"); } public OnGameModeInit() { SetGameModeText("Selfmade v0,0,0"); //MYSQL Verbindung Handle=mysql_connect (MYSQL_HOST,MYSQL_USER,MYSQL_DATA,MYSQL_PASS); if (mysql_errno() <1) print ("MYSQL: Die Verbindung war erfolgreich!"), mysql_log (LOG_ALL);else print ("MYSQL: Die Verbindung konnte nicht hergestellt werden! | Server wirt herundergefahren!"), SendRconCommand ("exit"); return 1; } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetSpawnInfo(playerid,0,0,0,0,0,0,0,0,0,0,0,0); SpawnPlayer(playerid); return 1; } public OnPlayerConnect(playerid) { new query [256]; mysql_format (Handle, query, sizeof (query), "SELECT * FROM user WHERE Username='%e'",Spielername(playerid)); mysql_tquery(Handle,query,"UserCheck","i",playerid); ClearChat(playerid); TogglePlayerSpectating(playerid,1); //news auf 0 Logintest[playerid]=0; return 1; } public OnPlayerDisconnect(playerid, reason) { SpielerSpeichern(playerid); return 1; } public OnPlayerSpawn(playerid) { SetPlayerVirtualWorld(playerid,0); SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid,1); if(pInfo[playerid][pNeuling]==1) { ClearChat(playerid); SendClientMessage(playerid,geld,"Herzlich Willkommen!"); SetPlayerPos(playerid,858.8041,-1655.6134,13.5523); SetPlayerFacingAngle(playerid,1.0462); pInfo[playerid][pNeuling]=0; pInfo[playerid][pLeben]=100; if(pInfo[playerid][pGeschlecht]==1) { SetPlayerSkin(playerid,60); } else { SetPlayerSkin(playerid,40); } GameTextForPlayer(playerid,"~y~Wilkommen ~n~auf ~n~Den besten ~g~Sever",6000,4); SpielerSpeichern(playerid); } else { SendClientMessage(playerid,geld,"Willkommen Zurück!"); SetPlayerPos(playerid,858.8041,-1655.6134,13.5523); SetPlayerFacingAngle(playerid,1.0462); if(pInfo[playerid][pGeschlecht]==1) { SetPlayerSkin(playerid,60); } else { SetPlayerSkin(playerid,40); } } SetPlayerColor(playerid,0xF3F3F3FF); return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { // Do something here return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } public OnRconCommand(cmd[]) { return 1; } public OnPlayerRequestSpawn(playerid) { return 1; } public OnObjectMoved(objectid) { return 1; } public OnPlayerObjectMoved(playerid, objectid) { return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } public OnVehicleMod(playerid, vehicleid, componentid) { return 1; } public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { return 1; } public OnVehicleRespray(playerid, vehicleid, color1, color2) { return 1; } public OnPlayerSelectedMenuRow(playerid, row) { return 1; } public OnPlayerExitedMenu(playerid) { return 1; } public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } public OnRconLoginAttempt(ip[], password[], success) { return 1; } public OnPlayerUpdate(playerid) { return 1; } public OnPlayerStreamIn(playerid, forplayerid) { return 1; } public OnPlayerStreamOut(playerid, forplayerid) { return 1; } public OnVehicleStreamIn(vehicleid, forplayerid) { return 1; } public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { //mysql dialogen if(dialogid == DIALOG_REGISTER) { if(!response)return Kick(playerid); SetPVarString(playerid,"passwortvar",inputtext); if(strlen(inputtext) >=4) { ShowPlayerDialog(playerid,DIALOG_CHAR1,DIALOG_STYLE_MSGBOX,"{00FFFA}Charackter 1/3","{FFFFFF}Welches Geschlecht bist du?","{00FFFA}Männlich","{00FFFA}Weiblich"); } else { ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"{00FFFA}Neuanfang","{00FFFA}Herzlich Willkommen{FFFFFF},\n{FF0023}Fehler: Eingabe ist Falsch{FFFFFF}\n auf unseren Server bitte geben ein Passwort ein","{00FFFA}Weiter","{00FFFA}Abbrechen"); } } if(dialogid == DIALOG_CHAR1) { if(response) { //männ pInfo[playerid][pGeschlecht]=1; ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was ech gibt Regeln?","00FFFA}Weiter","00FFFA}Abbrechen"); } else { //weib pInfo[playerid][pGeschlecht]=2; ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was ech gibt Regeln?","00FFFA}Weiter","00FFFA}Abbrechen"); } } if(dialogid == DIALOG_CHAR2) { if(response) { if(listitem==0) { ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was ech gibt Regeln?","00FFFA}Weiter","00FFFA}Abbrechen"); } if(listitem==1) { Kick(playerid); } if(listitem==2) { Kick(playerid); } if(listitem==3) { ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","{FFFFFF}Gebe nun Dein alter an(zwichen 18 bist 48 )","{00FFFA}Weiter","{00FFFA}Abbrechen"); } } else {Kick (playerid);} } if(dialogid == DIALOG_CHAR3) { if(response) { if(IsNummeric(inputtext)) { //new alterabfrage=strval(inputtext); if(strval(inputtext)>=18 && strval(inputtext) <=48) { pInfo[playerid][pAlter]=strval(inputtext); pInfo[playerid][pEingeloggt]=1; pInfo[playerid][pNeuling]=1; new query [256],passworteingabe[128]; GetPVarString(playerid,"passwortvar",passworteingabe,128); mysql_format(Handle, query, sizeof(query), "INSERT INTO user (Username, Passwort) VALUES ('%e',MD5('%e'))",Spielername(playerid),passworteingabe); mysql_function_query(Handle,query,true,"OnPlayerRegister","i",playerid); printf("%s",query); } else { ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","\n{FF0023}Fehler: Eingabe ist Falsch{FFFFFF}Gebe nun Dein alter an(zwichen 18 bist 48 )","{00FFFA}Weiter","{00FFFA}Abbrechen"); } } else { ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","\n{FF0023}Fehler: Eingabe ist Falsch{FFFFFF}Gebe nun Dein alter an(zwichen 18 bist 48 )","{00FFFA}Weiter","{00FFFA}Abbrechen"); } } else {Kick (playerid);} } if(dialogid == DIALOG_LOGIN) { if(!response)return Kick(playerid); new query[256]; mysql_format(Handle,query,sizeof(query),"SELECT * user FROM WHERE Username='%e'AND Passwort=MD5('%e')",Spielername(playerid),inputtext); mysql_tquery(Handle,query,"OnPassordResponse","i",playerid); return 1; } return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } //OnPlayerRegister forward OnPlayerRegister(playerid); public OnPlayerRegister(playerid) { pInfo[playerid][db_id]=cache_insert_id(Handle); TogglePlayerSpectating(playerid,0); SpawnPlayer(playerid); SetCameraBehindPlayer(playerid); return 1; } //User-Check forward UserCheck(playerid); public UserCheck(playerid) { new num_rows, num_fields; cache_get_data(num_rows,num_fields,Handle); SetPlayerVirtualWorld(playerid,1); if(num_rows == 0) { //reg ClearChat(playerid); ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"{00FFFA}Neuanfang","{00FFFA}Herzlich Willkommen{FFFFFF},\n auf unseren Server bitte geben ein Passwort ein","{00FFFA}Weiter","{00FFFA}Abbrechen"); } else { //log ClearChat(playerid); ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{00FFFA}Einloggen","{00FFFA}Willkommen Zurück{FFFFFF},\n auf unseren Server bitte geben Dein Passwort ein","{00FFFA}Weiter","{00FFFA}Abbrechen"); } return 1; } //für login forward OnPasswordResponse(playerid); public OnPasswordResponse(playerid) { new num_fields,num_rows; cache_get_data(num_rows,num_fields); if(num_rows==0) { //Passwort Falsch Logintest[playerid]+=1; new string [250]; format(string,sizeof(string),"{00FFFA}Einloggen {FF0005}[%d/3]",Logintest[playerid]); if(Logintest[playerid]>=3) { ShowPlayerDialog(playerid,DIALOG_LOGINT,DIALOG_STYLE_MSGBOX,"{FF0005}Fehler","{FF0005}Maximale {FFFFFF}Versuche verbraucht sie werden aus sicherheits gründen von Server entfernt!","{FF0005}Okay",""); return SetTimerEx("KickHackInfo",1000,false,"i",playerid); } else { ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,string,"{00FFFA}Willkommen Zurück{FFFFFF},\n auf unseren Server bitte geben Dein Passwort ein","{00FFFA}Weiter","{00FFFA}Abbrechen"); } } else { //Passwort Richtig SendClientMessage(playerid,geld,"Erfolgreich Eingeloggt"); LoadAccount(playerid); } return 1; } //LoadAccount stock LoadAccount(playerid) { pInfo[playerid][db_id]=cache_get_field_content_int(0,"ID",Handle); pInfo[playerid][pEingeloggt]=1; pInfo[playerid][pAlter]=cache_get_field_content_int(0,"Alter",Handle); pInfo[playerid][pGeschlecht]=cache_get_field_content_int(0,"Geschlecht",Handle); pInfo[playerid][pSkin]=cache_get_field_content_int(0,"Skin",Handle); pInfo[playerid][pNeuling]=cache_get_field_content_int(0,"Neuling",Handle); pInfo[playerid][pLeben]=cache_get_field_content_float(0,"Leben",Handle); pInfo[playerid][pRussi]=cache_get_field_content_float(0,"Russi",Handle); SetPlayerHealth(playerid,pInfo[playerid][pLeben]); SetPlayerArmour(playerid,pInfo[playerid][pRussi]); SpawnPlayer(playerid); TogglePlayerSpectating(playerid,0); SetCameraBehindPlayer(playerid); return 1; } //SpielerSpeichern stock SpielerSpeichern(playerid) { if(pInfo[playerid][pEingeloggt]!=1)return 1; if(IsPlayerNPC(playerid))return 1; GetPlayerHealth(playerid,pInfo[playerid][pLeben]); GetPlayerArmour(playerid,pInfo[playerid][pRussi]); new query[256]; mysql_format(Handle,query,sizeof (query),"Update `user` Set `Skin`='%d',`Alter`='%d',`Geschlecht`='%d',`Neuling`='%d',`Leben`='%.0f',`Russi`='%.0f' WHERE `ID`='%i'",GetPlayerSkin(playerid), pInfo[playerid][pAlter], pInfo[playerid][pGeschlecht],pInfo[playerid][pNeuling],pInfo[playerid][pLeben],pInfo[playerid][pRussi],pInfo[playerid][db_id]); mysql_pquery(Handle,query,"",""); printf("%s",query); pInfo[playerid][pEingeloggt]=0; return 1; } //KickHackInfo forward KickHackInfo(playerid); public KickHackInfo(playerid) { return Kick(playerid); } //Spielername stock Spielername(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); return name; } //Clear-Chat stock ClearChat(playerid) { for(new i = 0;i<100;i++) { SendClientMessage(playerid,weiss,""); } return 1; } //IsNummeric stock IsNummeric(string[]) { for(new i=0,j=strlen(string);i<j;i++) { if((string[i] > '9' || string[i] < '0'))return 0; } return 1; }
Server-Log
Code
Alles anzeigenSA-MP Dedicated Server ---------------------- v0.3.7-R2, (C)2005-2015 SA-MP Team [08:07:19] [08:07:19] Server Plugins [08:07:19] -------------- [08:07:19] Loading plugin: streamer [08:07:19] *** Streamer Plugin v2.9.4 by Incognito loaded *** [08:07:19] Loaded. [08:07:19] Loading plugin: mysql [08:07:19] >> plugin.mysql: R39-3 successfully loaded. [08:07:19] Loaded. [08:07:19] Loaded 2 plugins. [08:07:19] [08:07:19] Filterscripts [08:07:19] --------------- [08:07:19] Loading filterscript 'samplife-mapps.amx'... [08:07:19] Server Objecte werden geladen [08:07:19] 0 Gemappte Objecte Geladen [08:07:19] Loaded 1 filterscripts. [08:07:19] MYSQL: Die Verbindung war erfolgreich! [08:07:19] ---------------------------------- [08:07:19] selfmade by kevin [08:07:19] ---------------------------------- [08:07:19] Number of vehicle models: 0 [08:08:52] [connection] 127.0.0.1:64023 requests connection cookie. [08:08:53] [connection] incoming connection: 127.0.0.1:64023 id: 0 [08:08:53] [join] ShadowKev1999 has joined the server (0:127.0.0.1) [08:09:13] INSERT INTO user (Username, Passwort) VALUES ('ShadowKev1999',MD5('kevin7372')) [08:09:13] Update `user` Set `Skin`='60',`Alter`='20',`Geschlecht`='1',`Neuling`='0',`Leben`='0',`Russi`='0' WHERE `ID`='0' [08:09:20] [part] ShadowKev1999 has left the server (0:1) [08:09:56] [connection] 127.0.0.1:53304 requests connection cookie. [08:09:57] [connection] incoming connection: 127.0.0.1:53304 id: 0 [08:09:57] [join] ShadowKev1999 has joined the server (0:127.0.0.1) [08:10:15] [part] ShadowKev1999 has left the server (0:1) Console input: gmx [08:10:46] MYSQL: Die Verbindung war erfolgreich! [08:10:46] ---------------------------------- [08:10:46] selfmade by kevin [08:10:46] ---------------------------------- [08:10:46] Number of vehicle models: 0 [08:12:18] [connection] 127.0.0.1:56461 requests connection cookie. [08:12:19] [connection] 127.0.0.1:56461 requests connection cookie. [08:12:20] [connection] incoming connection: 127.0.0.1:56461 id: 0 [08:12:21] [join] ShadowKev1999 has joined the server (0:127.0.0.1) [08:12:37] [part] ShadowKev1999 has left the server (0:1)
mysql-log
Code
Alles anzeigen[08:03:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:03:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:03:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:03:40] [DEBUG] CMySQLConnection::Connect - connection was successful [08:03:40] [DEBUG] CMySQLConnection::Connect - connection was successful [08:03:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:03:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:03:41] [DEBUG] CMySQLConnection::Connect - connection was successful [08:03:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:05:41] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "selfmade", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [08:05:41] [DEBUG] CMySQLHandle::Create - creating new connection.. [08:05:41] [WARNING] CMySQLHandle::Create - connection already exists [08:05:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:05:41] [DEBUG] CMySQLConnection::Connect - connection was successful [08:05:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:05:41] [DEBUG] mysql_errno - connection: 1 [08:05:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:05:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:05:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:05:41] [DEBUG] CMySQLConnection::Connect - connection was successful [08:05:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:05:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:05:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:07:19] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:07:19] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:07:19] [DEBUG] CMySQLConnection::Connect - connection was successful [08:07:19] [DEBUG] CMySQLConnection::Connect - connection was successful [08:07:19] [DEBUG] CMySQLConnection::Connect - connection was successful [08:07:19] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:07:19] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:08:53] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * FROM user WHERE Username='%e'" [08:08:53] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM user WHERE Username='ShadowKev1999'", callback: "UserCheck", format: "i" [08:08:53] [DEBUG] CMySQLQuery::Execute[UserCheck] - starting query execution [08:08:53] [DEBUG] CMySQLQuery::Execute[UserCheck] - query was successfully executed within 0.737 milliseconds [08:08:53] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [08:08:53] [DEBUG] Calling callback "UserCheck".. [08:08:53] [DEBUG] cache_get_data - connection: 1 [08:08:53] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [08:09:13] [DEBUG] mysql_format - connection: 1, len: 256, format: "INSERT INTO user (Username, Passwort) VALUES ('%e',MD5('%e'))" [08:09:13] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO user (Username, Passwort) VALUES ('ShadowKev1999',MD", callback: "OnPlayerRegister", format: "i" [08:09:13] [DEBUG] CMySQLQuery::Execute[OnPlayerRegister] - starting query execution [08:09:13] [DEBUG] CMySQLQuery::Execute[OnPlayerRegister] - query was successfully executed within 21.49 milliseconds [08:09:13] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [08:09:13] [DEBUG] Calling callback "OnPlayerRegister".. [08:09:13] [DEBUG] cache_insert_id - connection: 1 [08:09:13] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [08:09:13] [DEBUG] mysql_format - connection: 1, len: 256, format: "Update `user` Set `Skin`='%d',`Alter`='%d',`Geschlecht`='%d',`Neuling`='%d',`Leben`='%.0f',`Russi`='%.0f' WHERE `ID`='%i'" [08:09:13] [DEBUG] mysql_pquery - connection: 1, query: "Update `user` Set `Skin`='60',`Alter`='20',`Geschlecht`='1',`Neu", callback: "(null)", format: "(null)" [08:09:13] [DEBUG] CMySQLQuery::Execute[] - starting query execution [08:09:13] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 28.804 milliseconds [08:09:13] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving [08:09:57] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * FROM user WHERE Username='%e'" [08:09:57] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM user WHERE Username='ShadowKev1999'", callback: "UserCheck", format: "i" [08:09:57] [DEBUG] CMySQLQuery::Execute[UserCheck] - starting query execution [08:09:57] [DEBUG] CMySQLQuery::Execute[UserCheck] - query was successfully executed within 0.432 milliseconds [08:09:57] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [08:09:57] [DEBUG] Calling callback "UserCheck".. [08:09:57] [DEBUG] cache_get_data - connection: 1 [08:09:57] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [08:10:05] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * user FROM WHERE Username='%e'AND Passwort=MD5('%e')" [08:10:05] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * user FROM WHERE Username='ShadowKev1999'AND Passwort=MD", callback: "OnPassordResponse", format: "i" [08:10:05] [DEBUG] CMySQLQuery::Execute[OnPassordResponse] - starting query execution [08:10:05] [ERROR] CMySQLQuery::Execute[OnPassordResponse] - (error #1064) 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 'user FROM WHERE Username='ShadowKev1999'AND Passwort=MD5('kevin7372')' at line 1 [08:10:05] [DEBUG] CMySQLQuery::Execute[OnPassordResponse] - error will be triggered in OnQueryError [08:10:46] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "selfmade", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [08:10:46] [DEBUG] CMySQLHandle::Create - creating new connection.. [08:10:46] [WARNING] CMySQLHandle::Create - connection already exists [08:10:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:10:46] [DEBUG] CMySQLConnection::Connect - connection was successful [08:10:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:10:46] [DEBUG] mysql_errno - connection: 1 [08:10:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:10:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:10:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:10:46] [DEBUG] CMySQLConnection::Connect - connection was successful [08:10:46] [DEBUG] CMySQLConnection::Connect - connection was successful [08:10:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:10:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:12:21] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * FROM user WHERE Username='%e'" [08:12:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM user WHERE Username='ShadowKev1999'", callback: "UserCheck", format: "i" [08:12:21] [DEBUG] CMySQLQuery::Execute[UserCheck] - starting query execution [08:12:21] [DEBUG] CMySQLQuery::Execute[UserCheck] - query was successfully executed within 0.635 milliseconds [08:12:21] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [08:12:21] [DEBUG] Calling callback "UserCheck".. [08:12:21] [DEBUG] cache_get_data - connection: 1 [08:12:21] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [08:12:29] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * user FROM WHERE Username='%e'AND Passwort=MD5('%e')" [08:12:29] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * user FROM WHERE Username='ShadowKev1999'AND Passwort=MD", callback: "OnPassordResponse", format: "i" [08:12:29] [DEBUG] CMySQLQuery::Execute[OnPassordResponse] - starting query execution [08:12:29] [ERROR] CMySQLQuery::Execute[OnPassordResponse] - (error #1064) 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 'user FROM WHERE Username='ShadowKev1999'AND Passwort=MD5('kevin7372')' at line 1 [08:12:29] [DEBUG] CMySQLQuery::Execute[OnPassordResponse] - error will be triggered in OnQueryError
-
guten morgen,ich habe der problem das ich nicht einlogen kann und mein leben auf 0 ist. registieren geht ohne problemaber mit einlogen nicht.
script
C
Alles anzeigen#include <a_samp> #include <a_mysql> #include <md5> //MYSL DATEN #define MYSQL_HOST "127.0.0.1" #define MYSQL_USER "root" #define MYSQL_DATA "selfmade" #define MYSQL_PASS "" new Handle; enum playerInfo{ db_id, pEingeloggt, pNeuling, pAlter, pGeschlecht, pSkin, Float:pRussi, Float:pLeben }; new pInfo[MAX_PLAYERS][playerInfo]; //DIALOGE #define DIALOG_REGISTER 1 #define DIALOG_CHAR1 2 #define DIALOG_CHAR2 3 #define DIALOG_CHAR3 4 #define DIALOG_LOGIN 5 #define DIALOG_LOGINT 6 //Farben #define geld 0xFFFF00FF #define weiss 0xFFFFFFFF //news new Logintest[MAX_PLAYERS]; main() { print("\n----------------------------------"); print(" selfmade by kevin"); print("----------------------------------\n"); } public OnGameModeInit() { SetGameModeText("Selfmade v0,0,0"); //MYSQL Verbindung Handle=mysql_connect (MYSQL_HOST,MYSQL_USER,MYSQL_DATA,MYSQL_PASS); if (mysql_errno() <1) print ("MYSQL: Die Verbindung war erfolgreich!"), mysql_log (LOG_ALL);else print ("MYSQL: Die Verbindung konnte nicht hergestellt werden! | Server wirt herundergefahren!"), SendRconCommand ("exit"); return 1; } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetSpawnInfo(playerid,0,0,0,0,0,0,0,0,0,0,0,0); SpawnPlayer(playerid); return 1; } public OnPlayerConnect(playerid) { new query [256]; mysql_format (Handle, query, sizeof (query), "SELECT * FROM user WHERE Username='%e'",Spielername(playerid)); mysql_tquery(Handle,query,"UserCheck","i",playerid); ClearChat(playerid); TogglePlayerSpectating(playerid,1); //news auf 0 Logintest[playerid]=0; return 1; } public OnPlayerDisconnect(playerid, reason) { SpielerSpeichern(playerid); return 1; } public OnPlayerSpawn(playerid) { SetPlayerVirtualWorld(playerid,0); SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid,1); if(pInfo[playerid][pNeuling]==1) { ClearChat(playerid); SendClientMessage(playerid,geld,"Herzlich Willkommen!"); SetPlayerPos(playerid,858.8041,-1655.6134,13.5523); SetPlayerFacingAngle(playerid,1.0462); pInfo[playerid][pNeuling]=0; pInfo[playerid][pLeben]=100; if(pInfo[playerid][pGeschlecht]==1) { SetPlayerSkin(playerid,60); } else { SetPlayerSkin(playerid,40); } GameTextForPlayer(playerid,"~y~Wilkommen ~n~auf ~n~Den besten ~g~Sever",6000,4); SpielerSpeichern(playerid); } else { SendClientMessage(playerid,geld,"Willkommen Zurück!"); SetPlayerPos(playerid,858.8041,-1655.6134,13.5523); SetPlayerFacingAngle(playerid,1.0462); if(pInfo[playerid][pGeschlecht]==1) { SetPlayerSkin(playerid,60); } else { SetPlayerSkin(playerid,40); } } SetPlayerColor(playerid,0xF3F3F3FF); return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { // Do something here return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } public OnRconCommand(cmd[]) { return 1; } public OnPlayerRequestSpawn(playerid) { return 1; } public OnObjectMoved(objectid) { return 1; } public OnPlayerObjectMoved(playerid, objectid) { return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } public OnVehicleMod(playerid, vehicleid, componentid) { return 1; } public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { return 1; } public OnVehicleRespray(playerid, vehicleid, color1, color2) { return 1; } public OnPlayerSelectedMenuRow(playerid, row) { return 1; } public OnPlayerExitedMenu(playerid) { return 1; } public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } public OnRconLoginAttempt(ip[], password[], success) { return 1; } public OnPlayerUpdate(playerid) { return 1; } public OnPlayerStreamIn(playerid, forplayerid) { return 1; } public OnPlayerStreamOut(playerid, forplayerid) { return 1; } public OnVehicleStreamIn(vehicleid, forplayerid) { return 1; } public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { //mysql dialogen if(dialogid == DIALOG_REGISTER) { if(!response)return Kick(playerid); SetPVarString(playerid,"passwortvar",inputtext); if(strlen(inputtext) >=4) { ShowPlayerDialog(playerid,DIALOG_CHAR1,DIALOG_STYLE_MSGBOX,"{00FFFA}Charackter 1/3","{FFFFFF}Welches Geschlecht bist du?","{00FFFA}Männlich","{00FFFA}Weiblich"); } else { ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"{00FFFA}Neuanfang","{00FFFA}Herzlich Willkommen{FFFFFF},\n{FF0023}Fehler: Eingabe ist Falsch{FFFFFF}\n auf unseren Server bitte geben ein Passwort ein","{00FFFA}Weiter","{00FFFA}Abbrechen"); } } if(dialogid == DIALOG_CHAR1) { if(response) { //männ pInfo[playerid][pGeschlecht]=1; ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was ech gibt Regeln?","00FFFA}Weiter","00FFFA}Abbrechen"); } else { //weib pInfo[playerid][pGeschlecht]=2; ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was ech gibt Regeln?","00FFFA}Weiter","00FFFA}Abbrechen"); } } if(dialogid == DIALOG_CHAR2) { if(response) { if(listitem==0) { ShowPlayerDialog(playerid,DIALOG_CHAR2,DIALOG_STYLE_LIST,"{00FFFA}Charackter 2/3","{00AFFF}Hast du die Regeln gelesen?\n{00FF14}Ja\n{FF002D}Nein\n{F000FF}Was ech gibt Regeln?","00FFFA}Weiter","00FFFA}Abbrechen"); } if(listitem==1) { Kick(playerid); } if(listitem==2) { Kick(playerid); } if(listitem==3) { ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","{FFFFFF}Gebe nun Dein alter an(zwichen 18 bist 48 )","{00FFFA}Weiter","{00FFFA}Abbrechen"); } } else {Kick (playerid);} } if(dialogid == DIALOG_CHAR3) { if(response) { if(IsNummeric(inputtext)) { //new alterabfrage=strval(inputtext); if(strval(inputtext)>=18 && strval(inputtext) <=48) { pInfo[playerid][pAlter]=strval(inputtext); pInfo[playerid][pEingeloggt]=1; pInfo[playerid][pNeuling]=1; new query [256],passworteingabe[128]; GetPVarString(playerid,"passwortvar",passworteingabe,128); mysql_format(Handle, query, sizeof(query), "INSERT INTO user (Username, Passwort) VALUES ('%e',MD5('%e'))",Spielername(playerid),passworteingabe); mysql_function_query(Handle,query,true,"OnPlayerRegister","i",playerid); printf("%s",query); } else { ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","\n{FF0023}Fehler: Eingabe ist Falsch{FFFFFF}Gebe nun Dein alter an(zwichen 18 bist 48 )","{00FFFA}Weiter","{00FFFA}Abbrechen"); } } else { ShowPlayerDialog(playerid,DIALOG_CHAR3,DIALOG_STYLE_INPUT,"{00FFFA}Charackter 3/3","\n{FF0023}Fehler: Eingabe ist Falsch{FFFFFF}Gebe nun Dein alter an(zwichen 18 bist 48 )","{00FFFA}Weiter","{00FFFA}Abbrechen"); } } else {Kick (playerid);} } if(dialogid == DIALOG_LOGIN) { if(!response)return Kick(playerid); new query[256]; mysql_format(Handle,query,sizeof(query),"SELECT * user FROM WHERE Username='%e'AND Passwort=MD5('%e')",Spielername(playerid),inputtext); mysql_tquery(Handle,query,"OnPassordResponse","i",playerid); return 1; } return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } //OnPlayerRegister forward OnPlayerRegister(playerid); public OnPlayerRegister(playerid) { pInfo[playerid][db_id]=cache_insert_id(Handle); TogglePlayerSpectating(playerid,0); SpawnPlayer(playerid); SetCameraBehindPlayer(playerid); return 1; } //User-Check forward UserCheck(playerid); public UserCheck(playerid) { new num_rows, num_fields; cache_get_data(num_rows,num_fields,Handle); SetPlayerVirtualWorld(playerid,1); if(num_rows == 0) { //reg ClearChat(playerid); ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,"{00FFFA}Neuanfang","{00FFFA}Herzlich Willkommen{FFFFFF},\n auf unseren Server bitte geben ein Passwort ein","{00FFFA}Weiter","{00FFFA}Abbrechen"); } else { //log ClearChat(playerid); ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{00FFFA}Einloggen","{00FFFA}Willkommen Zurück{FFFFFF},\n auf unseren Server bitte geben Dein Passwort ein","{00FFFA}Weiter","{00FFFA}Abbrechen"); } return 1; } //für login forward OnPasswordResponse(playerid); public OnPasswordResponse(playerid) { new num_fields,num_rows; cache_get_data(num_rows,num_fields); if(num_rows==0) { //Passwort Falsch Logintest[playerid]+=1; new string [250]; format(string,sizeof(string),"{00FFFA}Einloggen {FF0005}[%d/3]",Logintest[playerid]); if(Logintest[playerid]>=3) { ShowPlayerDialog(playerid,DIALOG_LOGINT,DIALOG_STYLE_MSGBOX,"{FF0005}Fehler","{FF0005}Maximale {FFFFFF}Versuche verbraucht sie werden aus sicherheits gründen von Server entfernt!","{FF0005}Okay",""); return SetTimerEx("KickHackInfo",1000,false,"i",playerid); } else { ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,string,"{00FFFA}Willkommen Zurück{FFFFFF},\n auf unseren Server bitte geben Dein Passwort ein","{00FFFA}Weiter","{00FFFA}Abbrechen"); } } else { //Passwort Richtig SendClientMessage(playerid,geld,"Erfolgreich Eingeloggt"); LoadAccount(playerid); } return 1; } //LoadAccount stock LoadAccount(playerid) { pInfo[playerid][db_id]=cache_get_field_content_int(0,"ID",Handle); pInfo[playerid][pEingeloggt]=1; pInfo[playerid][pAlter]=cache_get_field_content_int(0,"Alter",Handle); pInfo[playerid][pGeschlecht]=cache_get_field_content_int(0,"Geschlecht",Handle); pInfo[playerid][pSkin]=cache_get_field_content_int(0,"Skin",Handle); pInfo[playerid][pNeuling]=cache_get_field_content_int(0,"Neuling",Handle); pInfo[playerid][pLeben]=cache_get_field_content_float(0,"Leben",Handle); pInfo[playerid][pRussi]=cache_get_field_content_float(0,"Russi",Handle); SetPlayerHealth(playerid,pInfo[playerid][pLeben]); SetPlayerArmour(playerid,pInfo[playerid][pRussi]); SpawnPlayer(playerid); TogglePlayerSpectating(playerid,0); SetCameraBehindPlayer(playerid); return 1; } //SpielerSpeichern stock SpielerSpeichern(playerid) { if(pInfo[playerid][pEingeloggt]!=1)return 1; if(IsPlayerNPC(playerid))return 1; GetPlayerHealth(playerid,pInfo[playerid][pLeben]); GetPlayerArmour(playerid,pInfo[playerid][pRussi]); new query[256]; mysql_format(Handle,query,sizeof (query),"Update `user` Set `Skin`='%d',`Alter`='%d',`Geschlecht`='%d',`Neuling`='%d',`Leben`='%.0f',`Russi`='%.0f' WHERE `ID`='%i'",GetPlayerSkin(playerid), pInfo[playerid][pAlter], pInfo[playerid][pGeschlecht],pInfo[playerid][pNeuling],pInfo[playerid][pLeben],pInfo[playerid][pRussi],pInfo[playerid][db_id]); mysql_pquery(Handle,query,"",""); printf("%s",query); pInfo[playerid][pEingeloggt]=0; return 1; } //KickHackInfo forward KickHackInfo(playerid); public KickHackInfo(playerid) { return Kick(playerid); } //Spielername stock Spielername(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); return name; } //Clear-Chat stock ClearChat(playerid) { for(new i = 0;i<100;i++) { SendClientMessage(playerid,weiss,""); } return 1; } //IsNummeric stock IsNummeric(string[]) { for(new i=0,j=strlen(string);i<j;i++) { if((string[i] > '9' || string[i] < '0'))return 0; } return 1; }
Server-Log
Code
Alles anzeigenSA-MP Dedicated Server ---------------------- v0.3.7-R2, (C)2005-2015 SA-MP Team [08:07:19] [08:07:19] Server Plugins [08:07:19] -------------- [08:07:19] Loading plugin: streamer [08:07:19] *** Streamer Plugin v2.9.4 by Incognito loaded *** [08:07:19] Loaded. [08:07:19] Loading plugin: mysql [08:07:19] >> plugin.mysql: R39-3 successfully loaded. [08:07:19] Loaded. [08:07:19] Loaded 2 plugins. [08:07:19] [08:07:19] Filterscripts [08:07:19] --------------- [08:07:19] Loading filterscript 'samplife-mapps.amx'... [08:07:19] Server Objecte werden geladen [08:07:19] 0 Gemappte Objecte Geladen [08:07:19] Loaded 1 filterscripts. [08:07:19] MYSQL: Die Verbindung war erfolgreich! [08:07:19] ---------------------------------- [08:07:19] selfmade by kevin [08:07:19] ---------------------------------- [08:07:19] Number of vehicle models: 0 [08:08:52] [connection] 127.0.0.1:64023 requests connection cookie. [08:08:53] [connection] incoming connection: 127.0.0.1:64023 id: 0 [08:08:53] [join] ShadowKev1999 has joined the server (0:127.0.0.1) [08:09:13] INSERT INTO user (Username, Passwort) VALUES ('ShadowKev1999',MD5('kevin7372')) [08:09:13] Update `user` Set `Skin`='60',`Alter`='20',`Geschlecht`='1',`Neuling`='0',`Leben`='0',`Russi`='0' WHERE `ID`='0' [08:09:20] [part] ShadowKev1999 has left the server (0:1) [08:09:56] [connection] 127.0.0.1:53304 requests connection cookie. [08:09:57] [connection] incoming connection: 127.0.0.1:53304 id: 0 [08:09:57] [join] ShadowKev1999 has joined the server (0:127.0.0.1) [08:10:15] [part] ShadowKev1999 has left the server (0:1) Console input: gmx [08:10:46] MYSQL: Die Verbindung war erfolgreich! [08:10:46] ---------------------------------- [08:10:46] selfmade by kevin [08:10:46] ---------------------------------- [08:10:46] Number of vehicle models: 0 [08:12:18] [connection] 127.0.0.1:56461 requests connection cookie. [08:12:19] [connection] 127.0.0.1:56461 requests connection cookie. [08:12:20] [connection] incoming connection: 127.0.0.1:56461 id: 0 [08:12:21] [join] ShadowKev1999 has joined the server (0:127.0.0.1) [08:12:37] [part] ShadowKev1999 has left the server (0:1)
mysql-log
Code
Alles anzeigen[08:03:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:03:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:03:40] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:03:40] [DEBUG] CMySQLConnection::Connect - connection was successful [08:03:40] [DEBUG] CMySQLConnection::Connect - connection was successful [08:03:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:03:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:03:41] [DEBUG] CMySQLConnection::Connect - connection was successful [08:03:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:05:41] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "selfmade", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [08:05:41] [DEBUG] CMySQLHandle::Create - creating new connection.. [08:05:41] [WARNING] CMySQLHandle::Create - connection already exists [08:05:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:05:41] [DEBUG] CMySQLConnection::Connect - connection was successful [08:05:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:05:41] [DEBUG] mysql_errno - connection: 1 [08:05:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:05:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:05:41] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:05:41] [DEBUG] CMySQLConnection::Connect - connection was successful [08:05:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:05:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:05:41] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:07:19] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:07:19] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:07:19] [DEBUG] CMySQLConnection::Connect - connection was successful [08:07:19] [DEBUG] CMySQLConnection::Connect - connection was successful [08:07:19] [DEBUG] CMySQLConnection::Connect - connection was successful [08:07:19] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:07:19] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:08:53] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * FROM user WHERE Username='%e'" [08:08:53] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM user WHERE Username='ShadowKev1999'", callback: "UserCheck", format: "i" [08:08:53] [DEBUG] CMySQLQuery::Execute[UserCheck] - starting query execution [08:08:53] [DEBUG] CMySQLQuery::Execute[UserCheck] - query was successfully executed within 0.737 milliseconds [08:08:53] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [08:08:53] [DEBUG] Calling callback "UserCheck".. [08:08:53] [DEBUG] cache_get_data - connection: 1 [08:08:53] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [08:09:13] [DEBUG] mysql_format - connection: 1, len: 256, format: "INSERT INTO user (Username, Passwort) VALUES ('%e',MD5('%e'))" [08:09:13] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO user (Username, Passwort) VALUES ('ShadowKev1999',MD", callback: "OnPlayerRegister", format: "i" [08:09:13] [DEBUG] CMySQLQuery::Execute[OnPlayerRegister] - starting query execution [08:09:13] [DEBUG] CMySQLQuery::Execute[OnPlayerRegister] - query was successfully executed within 21.49 milliseconds [08:09:13] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [08:09:13] [DEBUG] Calling callback "OnPlayerRegister".. [08:09:13] [DEBUG] cache_insert_id - connection: 1 [08:09:13] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [08:09:13] [DEBUG] mysql_format - connection: 1, len: 256, format: "Update `user` Set `Skin`='%d',`Alter`='%d',`Geschlecht`='%d',`Neuling`='%d',`Leben`='%.0f',`Russi`='%.0f' WHERE `ID`='%i'" [08:09:13] [DEBUG] mysql_pquery - connection: 1, query: "Update `user` Set `Skin`='60',`Alter`='20',`Geschlecht`='1',`Neu", callback: "(null)", format: "(null)" [08:09:13] [DEBUG] CMySQLQuery::Execute[] - starting query execution [08:09:13] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 28.804 milliseconds [08:09:13] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving [08:09:57] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * FROM user WHERE Username='%e'" [08:09:57] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM user WHERE Username='ShadowKev1999'", callback: "UserCheck", format: "i" [08:09:57] [DEBUG] CMySQLQuery::Execute[UserCheck] - starting query execution [08:09:57] [DEBUG] CMySQLQuery::Execute[UserCheck] - query was successfully executed within 0.432 milliseconds [08:09:57] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [08:09:57] [DEBUG] Calling callback "UserCheck".. [08:09:57] [DEBUG] cache_get_data - connection: 1 [08:09:57] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [08:10:05] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * user FROM WHERE Username='%e'AND Passwort=MD5('%e')" [08:10:05] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * user FROM WHERE Username='ShadowKev1999'AND Passwort=MD", callback: "OnPassordResponse", format: "i" [08:10:05] [DEBUG] CMySQLQuery::Execute[OnPassordResponse] - starting query execution [08:10:05] [ERROR] CMySQLQuery::Execute[OnPassordResponse] - (error #1064) 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 'user FROM WHERE Username='ShadowKev1999'AND Passwort=MD5('kevin7372')' at line 1 [08:10:05] [DEBUG] CMySQLQuery::Execute[OnPassordResponse] - error will be triggered in OnQueryError [08:10:46] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "selfmade", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [08:10:46] [DEBUG] CMySQLHandle::Create - creating new connection.. [08:10:46] [WARNING] CMySQLHandle::Create - connection already exists [08:10:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:10:46] [DEBUG] CMySQLConnection::Connect - connection was successful [08:10:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:10:46] [DEBUG] mysql_errno - connection: 1 [08:10:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:10:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:10:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [08:10:46] [DEBUG] CMySQLConnection::Connect - connection was successful [08:10:46] [DEBUG] CMySQLConnection::Connect - connection was successful [08:10:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:10:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [08:12:21] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * FROM user WHERE Username='%e'" [08:12:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM user WHERE Username='ShadowKev1999'", callback: "UserCheck", format: "i" [08:12:21] [DEBUG] CMySQLQuery::Execute[UserCheck] - starting query execution [08:12:21] [DEBUG] CMySQLQuery::Execute[UserCheck] - query was successfully executed within 0.635 milliseconds [08:12:21] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [08:12:21] [DEBUG] Calling callback "UserCheck".. [08:12:21] [DEBUG] cache_get_data - connection: 1 [08:12:21] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [08:12:29] [DEBUG] mysql_format - connection: 1, len: 256, format: "SELECT * user FROM WHERE Username='%e'AND Passwort=MD5('%e')" [08:12:29] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * user FROM WHERE Username='ShadowKev1999'AND Passwort=MD", callback: "OnPassordResponse", format: "i" [08:12:29] [DEBUG] CMySQLQuery::Execute[OnPassordResponse] - starting query execution [08:12:29] [ERROR] CMySQLQuery::Execute[OnPassordResponse] - (error #1064) 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 'user FROM WHERE Username='ShadowKev1999'AND Passwort=MD5('kevin7372')' at line 1 [08:12:29] [DEBUG] CMySQLQuery::Execute[OnPassordResponse] - error will be triggered in OnQueryError
Wenn du das Passwort öfter verwendest, dann entferne es bitte auch schnellstmöglich aus der Server Log
-
Wenn du das Passwort öfter verwendest, dann entferne es bitte auch schnellstmöglich aus der Server Log
ist ja der kevin772pw derjederweiß,aber das hier ist nur nen test wegen scriping ubung
kann mir einer helfen?
-
Moin, eine Frage.
Wenn ich ein Gruppensystem entwerfe und ich habe 3 Datenbanktabellen.
User, Group, UserHasGroup
Und im Script folgende Enums
Code
Alles anzeigenenum pDataEnum { bool:pLoggedIn, bool:pIsBanned, bool:pIsNewbie, bool:pIsSpawned, p_ID, pName[MAX_PLAYER_NAME], pLevel, pExp, pExpMax, aLevel, pMoney, pSkin, pGroup, pPayday, } enum gDataEnum { // Dieses ist das wichtige Enum g_ID, gName[64], gDescription[512], gMaxMember, bool:is_fraction, } enum pHasGroupEnum { p_g_ID, p_ID, g_ID, gRank, }
Wie baue ich dann für die Gruppe, ein ähnliche erreichbare Variable/Array wie bei der Spieler Info?
Ich habe mal 3 zsm.-gebaut und weiß, das gInfo nicht gut gelöst ist, da setzt nämlich auch mein Problem an.
Codenew pInfo[MAX_PLAYERS][pDataEnum]; new gInfo[MAX_PLAYERS][gDataEnum]; // Diese Stelle ist mein Problem new pHasGroupInfo[MAX_PLAYERS][pHasGroupEnum];
Ich hatte mir das so ähnlich vorgestellt...
Code
Alles anzeigen#define MAX_GROUPS 20 enum gDataEnum { g_ID, gName[64], gDescription[512], gMaxMember, bool:is_fraction, } new gInfo[MAX_GROUPS][gDataEnum];
Aber funktioniert das so wie ich mir das vorstelle oder wäre das reine Zeitverschwendung?
Würde mich über Hinweise freuen.
Grüße
-
kann mir einer helfen?
Nutze kein MD5...(Hash Verfahren genauer erklärt)
Aber funktioniert das so wie ich mir das vorstelle oder wäre das reine Zeitverschwendung?
Unteres funktioniert.
Mit [MAX_GROUPS][gDataEnum].
Da solltest du keine Probleme haben.
-
Unteres funktioniert.
Mit [MAX_GROUPS][gDataEnum].
Da solltest du keine Probleme haben.
Für mich also Zusammengefasst:
Durch das #define hält er sich 20 Slots bereit.
Jetzt muss ich diese Slots ja befüllen, mit den Groups aus der DB.
Muss ich dann beim starten das Script mir alle Einträge holen und sie jeweils im gInfo[ID_DES_DB_EINTRAGES][gName] einspeichern
oder macht es mehr sinn sie in eine lokale ID zu initialisieren und diese mit jedem DB Eintrag belegen? Oder überdenke ich zuviel und sollte einfach schauen was passiert?
-
ID_DES_DB_EINTRAGES
Ja, das solltest du tun, schließlich speicherst du es ja auch genau so.
Da sollte ja schon irgendwo eine 1:1 Verknüpfung sein xD
-
Beitrag von ShadowKev1999 ()
Dieser Beitrag wurde vom Autor gelöscht (). -
Beitrag von Dr. Frauenarzt ()
Dieser Beitrag wurde vom Autor aus folgendem Grund gelöscht: Erledigt (). -
ich habe immer noch mein problem
-