Das ist aber nich das wo dein format drinne steht.
Beiträge von Marschl
-
-
Zeig mal die ganze Funktion
-
Das ist eigentlich egal... weil es garnicht reingeschrieben wird in der DatenBank
So create ich mein Player:
Code
Alles anzeigenstock CreatePlayer(playerid) { ResetPlayerMoney(playerid); sInfo[playerid][pAdminLevel] = 0; sInfo[playerid][pMapper] = 0; sInfo[playerid][pScripter] = 0; sInfo[playerid][pPremium] = 0; sInfo[playerid][pLevel] = 1; SetPlayerScore(playerid, sInfo[playerid][pLevel]); sInfo[playerid][pRespektpunkte] = 0; sInfo[playerid][pBarGeld] = 0; sInfo[playerid][pBankKonto] = 0; sInfo[playerid][pBankGeld] = 0; sInfo[playerid][pSkin] = 212; sInfo[playerid][pFraktion] = 0; sInfo[playerid][pFraktionRang] = 0; sInfo[playerid][pSpawn] = 0; sInfo[playerid][pHandy] = 0; sInfo[playerid][pHandynummer] = 0; sInfo[playerid][pPayDay] = 60; sInfo[playerid][pSpielzeit] = 0; sInfo[playerid][pJail] = 0; sInfo[playerid][pJailTime] = 0; sInfo[playerid][pPrison] = 0; sInfo[playerid][pPrisonCheckpoints] = 0; SpielerSpeichern(playerid); return 1; }
Wenn ich nach dem Registrieren Tab drücke habe ich 1 Level... aber wenn ich relogg ist es weg...
-
Hast du es so probiert?
Codemysql_format(mysql, query, sizeof(query), "UPDATE `Spieler` SET `IP`=%s, `Admin`=%i, `Kills`=%i, `Deaths`=%i, `Geld`=%i, `Personalausweis`=%i, `Persotimer`=%i, `Ptimerstart`=%i WHERE `ID`=%i",\ IP[playerid], pData[playerid][Admin], pData[playerid][Kills], pData[playerid][Deaths], pData[playerid][Money], pData[playerid][Personalausweis], pData[playerid][Persotimer], pData[playerid][Ptimerstart], pData[playerid][ID]);
-
Schreibe das mal in den PAWN Quellcode bitte
Probiere es mal so:
Codemysql_format(mysql, query, sizeof(query), "UPDATE `Spieler` SET `IP`=%i, `Admin`=%i, `Kills`=%i, `Deaths`=%i, `Geld`=%i, `Personalausweis`=%i, `Persotimer`=%i, `Ptimerstart`=%i WHERE `ID`=%i",\ IP[playerid], pData[playerid][Admin], pData[playerid][Kills], pData[playerid][Deaths], pData[playerid][Money], pData[playerid][Personalausweis], pData[playerid][Persotimer], pData[playerid][Ptimerstart], pData[playerid][ID]);
-
Leider wird das Level nicht gespeichert... aber der rest wie PayDay und Spielminuten schon...
Warum? -
HI
wie kann ich ein/makeleaer Befehl machen, der einen invitet wenn man in der Fraktion 0 ist und wenn er es nicht ist soll er in diese gesetzt werden....und auch pSpawn auf 0 gesetzt werden
Gruß
-
Meine Funktion:
Code
Alles anzeigenstock SpielerSpeichern(playerid) { if(sInfo[playerid][pEingeloggt] == 0)return 1; new query[2048], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(query, sizeof(query), "UPDATE user SET Age='%i', Geschlecht='%i', AdminLevel='%i', Mapper='%i', Scripter='%i', Premium='%i', Level='%i', Respektpunkte='%i'", sInfo[playerid][pAge], sInfo[playerid][pSex], sInfo[playerid][pAdminLevel], sInfo[playerid][pMapper], sInfo[playerid][pScripter], sInfo[playerid][pPremium], sInfo[playerid][pLevel], sInfo[playerid][pRespektpunkte]); format(query, sizeof(query), "BarGeld='%i', BankKonto='%i', BankGeld='%i',Skin='%i', Fraktion='%i', FraktionRang='%i', Spawn='%i', Handy='%i', Handynummer='%i'", query, GetPlayerMoney(playerid), sInfo[playerid][pBankKonto], sInfo[playerid][pBankGeld],sInfo[playerid][pSkin], sInfo[playerid][pFraktion], sInfo[playerid][pFraktionRang], sInfo[playerid][pSpawn], sInfo[playerid][pHandy], sInfo[playerid][pHandynummer]); format(query, sizeof(query), "%sPayDay='%i', Spielzeit='%i', Jail='%i', JailTime='%i', Prison='%i', PrisonCheckpoints='%i' WHERE username='%s'", query, sInfo[playerid][pPayDay], sInfo[playerid][pSpielzeit], sInfo[playerid][pJail], sInfo[playerid][pJailTime], sInfo[playerid][pPrison], sInfo[playerid][pPrisonCheckpoints], name); mysql_function_query(Handle, query, false, "", ""); printf(query); return 1; }
-
-
1. MySQL Log:
Code[17:24:03] [ERROR] CMySQLQuery::Execute[()] - (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 'BarGeld='85', BankKonto='0', BankGeld='0',Skin='0', Fraktion='0', FraktionRang='' at line 1
ServerLog
Code[17:24:03] BarGeld='85', BankKonto='0', BankGeld='0',Skin='0', Fraktion='0', FraktionRang='0', Spawn='0', Handy='0', Handynummer='0'PayDay='0', Spielzeit='0', Jail='0', JailTime='0', Prison='0', PrisonCheckpoints='0' WHERE username='justSh4kr0n' [17:24:03] [part] justSh4kr0n has left the server (0:1)
-
-
-
-
Also ich habe es eingefügt,.... aber es wird nicht gespeichert. Es wird nur geladen
-
Das ist die Login funktion wo ich den Player lade:
Code
Alles anzeigenforward OnPasswortResponse(playerid); public OnPasswortResponse(playerid) { new num_rows, num_fields; cache_get_data(num_rows, num_fields, Handle); if(num_rows) { //Passwort richtig SpielerLaden(playerid); SpawnPlayer(playerid); } else { //Passwort falsch SendClientMessage(playerid, -1, "Das eingegebene Passwort ist falsch!"); new str[145], name[MAX_PLAYER_NAME], ip[16]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); GetPlayerIp(playerid, ip, sizeof(ip)); format(str, sizeof(str), ""#HTML_GELB"Hallo %s \n"#HTML_WEIS"Dein Account wurde gefunden! \nBitte gib nun dein Passwort ein \n Deine IP: "#HTM_GELB"%s", name, ip); ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,""ServerTag"Login",str ,"Login","Abbrechen"); } return 1; }
@Jeffrydas Problem ist, dass es gar nicht gespeichert wird
Und so lade ich mein Spieler:
Code
Alles anzeigenstock SpielerLaden(playerid) { sInfo[playerid][pID] = cache_get_field_content_int(0, "id", Handle); sInfo[playerid][pEingeloggt] = 1; sInfo[playerid][pAge] = cache_get_field_content_int(0,"Age",Handle); sInfo[playerid][pSex] = cache_get_field_content_int(0,"Geschlecht",Handle); sInfo[playerid][pAdminLevel] = cache_get_field_content_int(0,"AdminLevel",Handle); sInfo[playerid][pMapper] = cache_get_field_content_int(0,"Mapper",Handle); sInfo[playerid][pScripter] = cache_get_field_content_int(0,"Scripter",Handle); sInfo[playerid][pPremium] = cache_get_field_content_int(0,"Premium",Handle); sInfo[playerid][pLevel] = cache_get_field_content_int(0,"Level",Handle); SetPlayerScore(playerid, sInfo[playerid][pLevel]); sInfo[playerid][pRespektpunkte] = cache_get_field_content_int(0,"Respektpunkte",Handle); sInfo[playerid][pBarGeld] = cache_get_field_content_int(0,"BarGeld",Handle); ResetPlayerMoney(playerid); GivePlayerMoney(playerid, sInfo[playerid][pBarGeld]); sInfo[playerid][pBankKonto] = cache_get_field_content_int(0,"BankKonto",Handle); sInfo[playerid][pBankGeld] = cache_get_field_content_int(0,"BankGeld",Handle); sInfo[playerid][pSkin] = cache_get_field_content_int(0,"Skin",Handle); SetPlayerSkin(playerid, sInfo[playerid][pSkin]); sInfo[playerid][pFraktion] = cache_get_field_content_int(0,"Fraktion",Handle); sInfo[playerid][pFraktionRang] = cache_get_field_content_int(0,"FraktionRang",Handle); sInfo[playerid][pSpawn] = cache_get_field_content_int(0,"Spawn",Handle); sInfo[playerid][pHandy] = cache_get_field_content_int(0,"Handy",Handle); sInfo[playerid][pHandynummer] = cache_get_field_content_int(0,"Handynummer",Handle); sInfo[playerid][pPayDay] = cache_get_field_content_int(0,"PayDay",Handle); sInfo[playerid][pSpielzeit] = cache_get_field_content_int(0,"Spielzeit",Handle); sInfo[playerid][pJail] = cache_get_field_content_int(0,"Jail",Handle); sInfo[playerid][pJailTime] = cache_get_field_content_int(0,"JailTime",Handle); sInfo[playerid][pPrison] = cache_get_field_content_int(0,"Prison",Handle); sInfo[playerid][pPrisonCheckpoints] = cache_get_field_content_int(0,"PrisonCheckpoints",Handle); return 1; }
-
Mein SpielerLaden
Code
Alles anzeigenstock SpielerLaden(playerid) { sInfo[playerid][pID] = cache_get_field_content_int(0, "id", Handle); sInfo[playerid][pEingeloggt] = 1; sInfo[playerid][pAge] = cache_get_field_content_int(0,"Age",Handle); sInfo[playerid][pSex] = cache_get_field_content_int(0,"Geschlecht",Handle); sInfo[playerid][pAdminLevel] = cache_get_field_content_int(0,"AdminLevel",Handle); sInfo[playerid][pMapper] = cache_get_field_content_int(0,"Mapper",Handle); sInfo[playerid][pScripter] = cache_get_field_content_int(0,"Scripter",Handle); sInfo[playerid][pPremium] = cache_get_field_content_int(0,"Premium",Handle); sInfo[playerid][pLevel] = cache_get_field_content_int(0,"Level",Handle); SetPlayerScore(playerid, sInfo[playerid][pLevel]); sInfo[playerid][pRespektpunkte] = cache_get_field_content_int(0,"Respektpunkte",Handle); sInfo[playerid][pBarGeld] = cache_get_field_content_int(0,"BarGeld",Handle); ResetPlayerMoney(playerid); GivePlayerMoney(playerid, sInfo[playerid][pBarGeld]); sInfo[playerid][pBankKonto] = cache_get_field_content_int(0,"BankKonto",Handle); sInfo[playerid][pBankGeld] = cache_get_field_content_int(0,"BankGeld",Handle); sInfo[playerid][pSkin] = cache_get_field_content_int(0,"Skin",Handle); SetPlayerSkin(playerid, sInfo[playerid][pSkin]); sInfo[playerid][pFraktion] = cache_get_field_content_int(0,"Fraktion",Handle); sInfo[playerid][pFraktionRang] = cache_get_field_content_int(0,"FraktionRang",Handle); sInfo[playerid][pSpawn] = cache_get_field_content_int(0,"Spawn",Handle); sInfo[playerid][pHandy] = cache_get_field_content_int(0,"Handy",Handle); sInfo[playerid][pHandynummer] = cache_get_field_content_int(0,"Handynummer",Handle); sInfo[playerid][pPayDay] = cache_get_field_content_int(0,"PayDay",Handle); sInfo[playerid][pSpielzeit] = cache_get_field_content_int(0,"Spielzeit",Handle); sInfo[playerid][pJail] = cache_get_field_content_int(0,"Jail",Handle); sInfo[playerid][pJailTime] = cache_get_field_content_int(0,"JailTime",Handle); sInfo[playerid][pPrison] = cache_get_field_content_int(0,"Prison",Handle); sInfo[playerid][pPrisonCheckpoints] = cache_get_field_content_int(0,"PrisonCheckpoints",Handle); return 1; }
-
Also der User ist da:
http://prntscr.com/a2963z -
Du meinst den User? mit der ID 0
-
-
In der datenbank oder im Script?