Offline |
|
Csatlakozott:2019.07.19. 10:58 Hozzászólások:175 Megköszönt másnak: 37 alkalommal
|
Megprobáltam megoldani, valamilyen szinten sikerült is táblákat létrehozza, viszont nem ment semmit, vagy éppen tölti be az adatokat, bezzeg amikor rá írtam, akkor azonnal a modom követelte.. De mindegy. Valaki esetleg tudna benne segiteni, hogy mi lehet a hiba? public plugin_cfg() { g_SqlTuple = SQL_MakeDbTuple(SQLINFO[0], SQLINFO[1], SQLINFO[2], SQLINFO[3]); Create_Table_Register(); Create_Table_Others(); } public Create_Table_Register(){ static Query[10048]; new Len; Len += formatex(Query[Len], charsmax(Query), "CREATE TABLE IF NOT EXISTS `Jatekos_Adatai`"); Len += formatex(Query[Len], charsmax(Query)-Len, "(`Nev` varchar(32) NOT NULL, "); Len += formatex(Query[Len], charsmax(Query)-Len, "`Felhasznalonev` varchar(32) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Jelszo` varchar(32) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Email` varchar(32) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Regisztralt` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`regDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Masodpercek` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Player_IP` varchar(35) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Player_SteamID` varchar(35) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY)"); SQL_ThreadQuery(g_SqlTuple, "createTableThread", Query); } public Create_Table_Others(){ static Query[10048]; new Len; Len += formatex(Query[Len], charsmax(Query), "CREATE TABLE IF NOT EXISTS `Jatekos_Cuccok`"); Len += formatex(Query[Len], charsmax(Query)-Len, "(`Nev` varchar(32) NOT NULL, "); Len += formatex(Query[Len], charsmax(Query)-Len, "`Masodpercek` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Dollars` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`SMS` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`BFS` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Szint` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Oles` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Cukor` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Zene_BE_KI` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Elolvas` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Erteke` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Prefix` varchar(32) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`PrefixVan` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Kicucc` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Kirakva` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Vip` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Perc` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Teljes_Kuldetesek` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Lerakott_Bomba` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Felrobbant_Bomba` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Felszedett_Bomba` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`QuestH` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`QuestNeed` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`QuestHave` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`QuestWeap` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`QuestHead` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`JutLada` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`JutKulcs` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`JutPont` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`JutDoll` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`KMegy` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`QuestNeed2` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`QuestHave2` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`QuestWeap2` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`QuestHead2` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`JutPenz` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`JutSMS` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`FegyokK` int(11) NOT NULL,"); for(new i;i < FEGYO; i++) Len += formatex(Query[Len], charsmax(Query)-Len, "`F%d` int(11) NOT NULL,", i); for(new i;i < LADA; i++) Len += formatex(Query[Len], charsmax(Query)-Len, "`L%d` int(11) NOT NULL,", i); for(new i;i < STK; i++) Len += formatex(Query[Len], charsmax(Query)-Len, "`St%d` int(11) NOT NULL,", i); for(new i;i < ERMEMAX; i++) Len += formatex(Query[Len], charsmax(Query)-Len, "`Erme%d` int(11) NOT NULL,", i); for(new i;i < 14; i++) Len += formatex(Query[Len], charsmax(Query)-Len, "`Skin%d` int(11) NOT NULL,", i); Len += formatex(Query[Len], charsmax(Query)-Len, "`Kulcs` int(11) NOT NULL,"); Len += formatex(Query[Len], charsmax(Query)-Len, "`Beolvasztott_Skin` int(11) NOT NULL, `id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY)"); SQL_ThreadQuery(g_SqlTuple, "createTableThread", Query); } public Load(id) { static Query[10048]; new Data[1], Name[32]; get_user_name(id, Name, 31); Data[0] = id; formatex(Query, charsmax(Query), "SELECT * FROM `Jatekos_Cuccok` WHERE Nev = ^"%s^";", name[id]); SQL_ThreadQuery(g_SqlTuple, "QuerySelectData", Query, Data, 1); } public QuerySelectData(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) { if(FailState == TQUERY_CONNECT_FAILED || FailState == TQUERY_QUERY_FAILED) { log_amx("%s", Error); return; } else { new id = Data[0]; if(SQL_NumRows(Query) > 0) { SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Felhasznalonev"), regFh[id], charsmax(regFh[])); SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Jelszo"), regJelszo[id], charsmax(regJelszo[])); SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Email"), g_Email[id], charsmax(g_Email[])); SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Prefix"), Chat_Prefix[id], charsmax(Chat_Prefix[])); SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "regDate"), RegI[id], charsmax(RegI[])); b_id[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "id")); Rang[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Szint")); Kulcs[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Kulcs")); Masodpercek[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Masodpercek")); Oles[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Oles")); Regisztralt[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Regisztralt")); Erteke[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Erteke")); kicucc[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Kicucc")); kirakva[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Kirakva")); VanPrefix[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "PrefixVan")); g_QuestMVP[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Teljes_Kuldetesek")); BeolvasztottSkin[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Beolvasztott_Skin")); Gun[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "FegyokK")); Off[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Zene_BE_KI")); P_Perc[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Perc")); Cukor[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Cukor")); Ertesito[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Elolvas")); SMS[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "SMS")); Dollar[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Dollars")); g_Quest[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "QuestH")); g_QuestKills[0][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "QuestNeed")); g_QuestKills[1][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "QuestHave")); g_QuestWeapon[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "QuestWeap")); g_QuestHead[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "QuestHead")); g_Jutalom[0][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "JutLada")); g_Jutalom[1][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "JutKulcs")); g_Jutalom[2][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "JutPont")); g_Jutalom[3][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "JutDoll")); Lerakott_bomba[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Lerakott_Bomba")); Felrobbant_bomba[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Felrobbant_Bomba")); Hatastalanitott_bomba[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Felszedett_Bomba")); g_Quest2[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "KMegy")); g_QuestKills2[0][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "QuestNeed2")); g_QuestKills2[1][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "QuestHave2")); g_QuestWeapon2[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "QuestWeap2")); g_QuestHead2[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "QuestHead2")); g_Jutalom2[0][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "JutPenz")); g_Jutalom2[1][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "JutSMS")); for(new i;i < FEGYO; i++) { new String[64]; formatex(String, charsmax(String), "F%d", i); OsszesSkin[i][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, String)); } for(new i;i < LADA; i++) { new String[64]; formatex(String, charsmax(String), "L%d", i); Lada[i][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, String)); } for(new i;i < STK; i++) { new String[64]; formatex(String, charsmax(String), "St%d", i); Statrak[i][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, String)); } for(new i;i < ERMEMAX; i++) { new String[64]; formatex(String, charsmax(String), "Erme%d", i); Ermek[i][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, String)); } for(new i;i < 14; i++) { new String[64]; formatex(String, charsmax(String), "Skin%d", i); Skin[i][id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, String)); } } else { Save(id); } } } public Load_Register(id){ static Query[10048]; new Data[1], Name[32]; get_user_name(id, Name, 31); Data[0] = id; formatex(Query, charsmax(Query), "SELECT * FROM `Jatekos_Adatai` WHERE Nev = ^"%s^";", name[id]); SQL_ThreadQuery(g_SqlTuple, "QuerySelectDataRegister", Query, Data, 1); } public QuerySelectDataRegister(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) { if(FailState == TQUERY_CONNECT_FAILED || FailState == TQUERY_QUERY_FAILED) { log_amx("%s", Error); return; } else { new id = Data[0]; if(SQL_NumRows(Query) > 0) { SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Felhasznalonev"), regFh[id], charsmax(regFh[])); SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Jelszo"), regJelszo[id], charsmax(regJelszo[])); Regisztralt[id] = SQL_ReadResult(Query, SQL_FieldNameToNum(Query, "Regisztralt")); } else { Save_Register(id); } } } public Save(id){ static Query[256]; formatex(Query, charsmax(Query), "INSERT INTO `Jatekos_Cuccok` (`Nev`) VALUES (^"%s^");", name[id]); SQL_ThreadQuery(g_SqlTuple, "QuerySetData", Query); } public Save_Register(id){ static Query[256]; new sPlayer_IP[35], sPlayer_SteamID[35]; get_user_ip(id, sPlayer_IP, charsmax(sPlayer_IP), 1); get_user_authid(id, sPlayer_SteamID, charsmax(sPlayer_SteamID)); formatex(Query, charsmax(Query), "INSERT INTO `Jatekos_Adatai` (`Nev`, `Player_IP`, `Player_SteamID` ) VALUES (^"%s^", ^"%s^", ^"%s^");", name[id], sPlayer_IP, sPlayer_SteamID); SQL_ThreadQuery(g_SqlTuple, "QuerySetData", Query); } public SQL_Update_Reg(id){ static Query[10048]; new Len; Len += formatex(Query[Len], charsmax(Query), "UPDATE `Jatekos_Adatai` SET Felhasznalonev = ^"%s^", ", regFh[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Jelszo = ^"%s^", ", regJelszo[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Email = ^"%s^", ", g_Email[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Regisztralt = ^"%i^" WHERE Nev = ^"%s^";", Regisztralt[id], name[id]); SQL_ThreadQuery(g_SqlTuple, "QuerySetData", Query); } public Update(id) { static Query[10048]; new Len; Len += formatex(Query[Len], charsmax(Query), "UPDATE `Jatekos_Cuccok` SET Dollars = ^"%i^", ",Dollar[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Szint = ^"%i^", ", Rang[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Masodpercek = ^"%i^", ", Masodpercek[id]+get_user_time(id)); Len += formatex(Query[Len], charsmax(Query)-Len, "Oles = ^"%i^", ", Oles[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Kulcs = ^"%i^", ", Kulcs[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Erteke = ^"%i^", ", Erteke[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Kicucc = ^"%i^", ", kicucc[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Kirakva = ^"%i^", ", kirakva[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Prefix = ^"%s^", ", Chat_Prefix[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "PrefixVan = ^"%i^", ", VanPrefix[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Beolvasztott_Skin = ^"%i^", ", BeolvasztottSkin[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Teljes_Kuldetesek = ^"%i^", ", g_QuestMVP[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "FegyokK = ^"%i^", ", Gun[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Zene_BE_KI = ^"%i^", ", Off[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Perc = ^"%i^", ", P_Perc[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Cukor = ^"%i^", ", Cukor[id]); Len += formatex(Query[Len], charsmax(Query)-Len, "Elolvas = ^"%i^", ", Ertesito[id]); Len += formatex(Query[Len], charsmax(Query)-Len,"QuestH = '%i', ", g_Quest[id]); Len += formatex(Query[Len], charsmax(Query)-Len,"QuestNeed = '%i', ", g_QuestKills[0][id]); Len += formatex(Query[Len], charsmax(Query)-Len,"QuestHave = '%i', ", g_QuestKills[1][id]); Len += formatex(Query[Len], charsmax(Query)-Len,"QuestWeap = '%i', ", g_QuestWeapon[id]); Len += formatex(Query[Len], charsmax(Query)-Len,"QuestHead = '%i', ", g_QuestHead[id]); Len += formatex(Query[Len], charsmax(Query)-Len,"JutLada = '%i', ", g_Jutalom[0][id]); Len += formatex(Query[Len], charsmax(Query)-Len,"JutKulcs = '%i', ", g_Jutalom[1][id]); Len += formatex(Query[Len], charsmax(Query)-Len,"JutPont = '%i', ", g_Jutalom[2][id]); Len += formatex(Query[Len], charsmax(Query)-Len,"JutDoll = '%i', ", g_Jutalom[3][id]); Len += formatex(Query[Len], charsmax(Query)-Len,"KMegy = '%i', ", g_Quest2[id]); Len += formatex(Query[Len], charsmax(Query)-Len,"QuestNeed2 = '%i', ", g_QuestKills2[0][id]); Len += formatex(Query[Len], charsmax(Query)-Len,"QuestHave2 = '%i', ", g_QuestKills2[1][id]); Len += formatex(Query[Len], charsmax(Query)-Len,"QuestWeap2 = '%i', ", g_QuestWeapon2[id]); Len += formatex(Query[Len], charsmax(Query)-Len,"QuestHead2= '%i', ", g_QuestHead2[id]); Len += formatex(Query[Len], charsmax(Query)-Len,"JutPenz = '%i', ", g_Jutalom2[0][id]); Len += formatex(Query[Len], charsmax(Query)-Len,"JutSMS = '%i', ", g_Jutalom2[1][id]); Len += formatex(Query[Len], charsmax(Query)-Len,"Lerakott_Bomba = '%i', ", Lerakott_bomba[id]); Len += formatex(Query[Len], charsmax(Query)-Len,"Felrobbant_Bomba = '%i', ", Felrobbant_bomba[id]); Len += formatex(Query[Len], charsmax(Query)-Len,"Felszedett_Bomba = '%i', ", Hatastalanitott_bomba[id]); for(new i;i < FEGYO; i++) Len += formatex(Query[Len], charsmax(Query)-Len, "F%d = ^"%i^", ", i, OsszesSkin[i][id]); for(new i;i < LADA; i++) Len += formatex(Query[Len], charsmax(Query)-Len, "L%d = ^"%i^", ", i, Lada[i][id]); for(new i;i < STK; i++) Len += formatex(Query[Len], charsmax(Query)-Len, "St%d = ^"%i^", ", i, Statrak[i][id]); for(new i;i < ERMEMAX; i++) Len += formatex(Query[Len], charsmax(Query)-Len, "Erme%d = ^"%i^", ", i, Ermek[i][id]); for(new i;i < 14; i++) Len += formatex(Query[Len], charsmax(Query)-Len, "Skin%d = ^"%i^", ", i, Skin[i][id]); Len += formatex(Query[Len], charsmax(Query)-Len, "SMS = ^"%i^" WHERE Nev = ^"%s^";", SMS[id], name[id]); SQL_ThreadQuery(g_SqlTuple, "QuerySetData", Query); } public createTableThread(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) { if(FailState == TQUERY_CONNECT_FAILED) set_fail_state("[HIBA*] NEM TUDTAM CSATLAKOZNI AZ ADATBAZISHOZ!"); else if(FailState == TQUERY_QUERY_FAILED) set_fail_state("Query Error"); if(Errcode) log_amx("[HIBA*] HIBAT DOBTAM: %s",Error); } public QuerySetData(FailState, Handle:Query, Error[], Errcode, Data[], DataSize, Float:Queuetime) { if(FailState == TQUERY_CONNECT_FAILED || FailState == TQUERY_QUERY_FAILED) { log_amx("%s", Error); return; } }
Tehát a "Jatekos_Cuccok" Táblát létrehozza, le is menti az adatokat, viszont nem tölt be semmit. A "Jatekos_Adatok" Táblát letrehozza viszont nem ment semmit, bele se irja az adatokat. Logban: L 03/07/2020 - 13:24:54: [MySQL] Invalid column: -1 L 03/07/2020 - 13:24:54: [AMXX] Run time error 10 (plugin "Lekvar_Beta.amxx") (native "SQL_ReadResult") - debug not enabled!
|
|