20.06.2014, 15:33
Hi guys,
I have big problem and I need help fast :S
I switch load and save system on SQLite(before I had y_INI) and I made system nice, but only problem is my arrays. I have 47 arrays(for now), later I'll have much much more.
When player sign up I have much arrays for put in player's row. So I made some code but that code don't work. Problem is in arrays for format for db_query.
I tested that code with print func. and when I complited sign up, in log is only prints to main array. That array had 3 bytes(3076 bits) and server stoped on that array... I tried to cut on more arrays with small size but then I stoped on db_query code. I don't Know how I can connect two strings ?
If someone Know how I can connect I'll be thankful
P.S.: Sorry for my bad English, I am from Croatia
I have big problem and I need help fast :S
I switch load and save system on SQLite(before I had y_INI) and I made system nice, but only problem is my arrays. I have 47 arrays(for now), later I'll have much much more.
When player sign up I have much arrays for put in player's row. So I made some code but that code don't work. Problem is in arrays for format for db_query.
I tested that code with print func. and when I complited sign up, in log is only prints to main array. That array had 3 bytes(3076 bits) and server stoped on that array... I tried to cut on more arrays with small size but then I stoped on db_query code. I don't Know how I can connect two strings ?
If someone Know how I can connect I'll be thankful
P.S.: Sorry for my bad English, I am from Croatia
Code:
public Variable_Registracije(playerid) { new inst_kod[25]; new name[24]; new ip[16]; new dan,mjesec,godina; new sat,minuta,sekunda; new string[128]; //QUERY DEFINICIJE new dbQUERY_naslovi1[512], dbQUERY_naslovi2[512]; new dbQUERY_valute1[512], dbQUERY_valute2[512], dbQUERY_valute3[512]; new dbQUERY1[512], dbQUERY2[512], dbQUERY3[256]; new dbQUERY_global1[1024], dbQUERY_global2[512]; new novac[4], banka[4], zaradio[4], zaradio_ukupno[4], x[4], y[4], z[4]; format(novac, 4, "550.00"); format(banka, 4, "0.00"); format(zaradio, 4, "0.00"); format(zaradio_ukupno, 4, "0.00"); format(x, 4, "0.0"); format(y, 4, "0.0"); format(z, 4, "0.0"); gpci(playerid, inst_kod, 25); GetPlayerName(playerid, name, 24); GetPlayerIp(playerid, ip, 16); getdate(godina, mjesec, dan); gettime(sat, minuta, sekunda); sat = getrealtime(); Info[false][Clanova]++; Korisnik[playerid][pRegistriran] = 2; Korisnik[playerid][pSatiIgranja] = false; Korisnik[playerid][pNovac] = 550.00; Korisnik[playerid][pSkin] = 299; Korisnik[playerid][pDan] = dan; Korisnik[playerid][pMjesec] = mjesec; Korisnik[playerid][pGodina] = godina; Korisnik[playerid][pID_Registracije] = Info[false][Clanova]; //FORMIRANJE NASLOVA format(dbQUERY_naslovi1, 512, "Ime, ID, Registriran, Sifra, Online, Novac, Spol, Grad, Godine, Jezik, Skin, Dan, Mjesec, Godina, Ban, Warn, e-Mail, Admin, GameMaster, Staff_Sifra, Staff_Status, Banova, Kickova, Posao, Ugovor, Banka_Novac, Kartica, Uzeo_Poslova, Poslova_Zapoceo"); format(dbQUERY_naslovi2, 512, "Poslova_Zavrsio, Zaradio_na_Poslu, Zaradio_na_Poslu_Ukupno, Posao_Uvod, Biznis, Vracena_Sifra, Kod_Registracije, Razina_Zastite, IP, Kresalo, Kresalo_PosX, Kresalo_PosY, Kresalo_PosZ, Kresalo_Int, Kresalo_VW, GPCI, GPCI_Kod, TD_Status"); //FORMIRANJE VALUTA format(dbQUERY_valute1, 512, "'%s', '%d', '%d', '%s', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d'", DB_Escape(name), Info[false][Clanova], 2, DB_Escape(Korisnik[playerid][pSifra]), 0, DB_Escape(novac), Korisnik[playerid][pSpol], dan, mjesec, godina, 0); format(dbQUERY_valute2, 512, "'%d', '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d', '%d', '%d'",0, DB_Escape(Korisnik[playerid][pMail]), 0, 0, DB_Escape("nista"), 0, 0, 0, 0, 0, DB_Escape(banka), 0, 0, 0, 0); format(dbQUERY_valute3, 512, "'%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%s', '%s', '%s', '%d', '%d', '%s', '%d', '%d'",DB_Escape(zaradio), DB_Escape(zaradio_ukupno), 0, 999, 0, 0, 1, DB_Escape(ip), 0, DB_Escape(x), DB_Escape(y), DB_Escape(z), 0, 0, DB_Escape(inst_kod), 0, 1); //IZVRSAVANJE RADNJE format(dbQUERY1, 512, "INSERT INTO KORISNICI (%s, %s)", dbQUERY_naslovi1, dbQUERY_naslovi2); format(dbQUERY2, 512, "VALUES (%s, %s,", dbQUERY_valute1, dbQUERY_valute2); format(dbQUERY3, 256, "%s)", dbQUERY_valute3); format(dbQUERY_global1, 1024, "%s %s ", dbQUERY1, dbQUERY2); format(dbQUERY_global2, 512, "%s", dbQUERY3); db_query(server_database, WHAT_NOW); //I STOPED ON THIS CODE. //IZBACIJE U LOG DA JE IGRAC REGISTRIRAN format(string, 128, "[%d.%d.%d. - %d:%d:%d] Igrac %s[%s] se uspjesno registrirao na Server.",dan,mjesec,godina,sat,minuta,sekunda,name,ip); RegisterLog(string); SpremiInfo(false); SpremiKorisnika(playerid); return 1; }