Offline |
|
|
Csatlakozott: 2016.09.10. 10:47 Hozzászólások: 5
|
Hali valaki tudna rá egy sqlt írni? public sql_update_account(id) { new szQuery[2508] new len = 0 new c[191] new client_name[33] get_user_name(id, client_name, 32) format(c, 190, "%s", client_name) replace_all(c, 190, "\", "\\") replace_all(c, 190, "'", "\'") len += format(szQuery[len], 2508, "UPDATE st_deathrun SET ") len += format(szQuery[len], 2508-len,"Szint = '%d', ", szint[id]) len += format(szQuery[len], 2508-len,"Pont = '%d', ", pont[id]) len += format(szQuery[len], 2508-len,"Elet = '%d', ", elet[id]) len += format(szQuery[len], 2508-len,"Lada = '%d', ", lada[id]) len += format(szQuery[len], 2508-len,"VipJog = '%d', ", g_VipJog[id]) len += format(szQuery[len], 2508-len,"PremiumLada = '%d', ", premiumlada[id]) len += format(szQuery[len], 2508-len,"Skes = '%d', ", knife[id]) len += format(szQuery[len], 2508-len,"Xp = '%d', ", xp[id]) len += format(szQuery[len], 2508-len,"Spistol = '%d', ", selectedpistol[id]) len += format(szQuery[len], 2508-len,"JegUSP = '%d', ", usp1[id]) len += format(szQuery[len], 2508-len,"HkUSP = '%d', ", usp2[id]) len += format(szQuery[len], 2508-len,"USPLada = '%d', ", usplada[id]) len += format(szQuery[len], 2508-len,"Perc = '%d', ", perc[id]) len += format(szQuery[len], 2508-len,"Ora = '%d', ", ora[id]) len += format(szQuery[len], 2508-len,"Rang = '%d', ", rang[id]) for(new i=0; i <= MAX-1; i++) { len += format(szQuery[len], 2508-len,"Usp%d = '%d', ", i, pistol[i][id]) } len += format(szQuery[len], 2508-len,"Jatekosnev = '%s'", c) len += format(szQuery[len], 2508-len,"WHERE Id = '%d'", g_Id[id]) SQL_ThreadQuery(g_SqlTuple,"sql_update_account_thread", szQuery) }
public sql_account_load_thread(FailState,Handle:Query,Error[],Errcode,szData[],DataSize) { if(FailState == TQUERY_CONNECT_FAILED || FailState == TQUERY_QUERY_FAILED) { log_amx("%s", Error) return } else { new id = szData[0]; if (szData[1] != get_user_userid(id)) return ; new szSqlPassword[100] SQL_ReadResult(Query, 2, szSqlPassword, 99) if(equal(g_Jelszo[id], szSqlPassword)) { SQL_ReadResult(Query, 3, g_Email[id], 99) g_Id[id] = SQL_ReadResult(Query, 0) szint[id] = SQL_ReadResult(Query, 6) pont[id] = SQL_ReadResult(Query, 7) elet[id] = SQL_ReadResult(Query, 8) lada[id] = SQL_ReadResult(Query, 9) g_VipJog[id] = SQL_ReadResult(Query, 10) premiumlada[id] = SQL_ReadResult(Query, 11) knife[id] = SQL_ReadResult(Query, 12) xp[id] = SQL_ReadResult(Query, 13) selectedpistol[id] = SQL_ReadResult(Query, 14) usp1[id] = SQL_ReadResult(Query, 15) usp2[id] = SQL_ReadResult(Query, 16) usplada[id] = SQL_ReadResult(Query, 17) perc[id] = SQL_ReadResult(Query, 18) ora[id] = SQL_ReadResult(Query, 19) rang[id] = SQL_ReadResult(Query, 20) for(new i=0; i <= MAX-1; i++) { pistol[i][id] = SQL_ReadResult(Query, 21+i) } print_color(id, "!g[s]T* !yÜdv!t %s!y, sikeresen bejelentkeztél",g_Felhasznalonev[id]) UdvozloUzenet() BetoltesVIPs(id) g_Folyamatban[id] = 0 g_Bejelentkezve[id] = true sql_update_account(id) } else { print_color(id, "!g[s]T* !yHibás Felhasználónév vagy Jelszó!y!") g_Folyamatban[id] = 0 showMenu_RegLog(id) } } }
_________________ It's hard to hold a candle, in a cold November Rain.
|
|