help sqlite
#1

Hello I have an error with the sqlite saved

I download a gm with sqlite system but I want to add a new saved and bugea me everything and keeps nothing I leave the code if I puden help


Код:
public OnGameModeInit()
{
    Database = db_open("ServerDatabase.db");
    format(DB_String, 900, "CREATE TABLE IF NOT EXISTS `USERS` (`NAME`, `PASSWORD`, `IP`, `POSX`, `POSY`, `POSZ`, `ANGLE`, `INTERIORID`, `BR`, `EMAIL`, `DINERO`, `DINEROBANK`, `SEXO`, `EDAD`, `SKIN`, `VIDA`, `CHALECO`, `ADMLVL`, `PHONENUMBER`, `INTERIOR`, `BANKA`,\
	`VBANK`, `VGROTTI`, `V247`, `VROPA`, `VFOOD`, `DUDE`, `WORK`, `LVL`, `VEH0`, `VEH1`, `VEH2`, `VEH3`, `VKEY0`, `VKEY1`, `VKEY2`, `VKEY3`,`PSTATUS`,");
    strcat(DB_Query, DB_String);

	format(DB_String, 900, "`PTOY0`, `PTOY1`, `PTOY2`, `PTOYMID0`, `PTOYMID1`, `PTOYMID2`, `PTOYBONE0`, `PTOYBONE1`, `PTOYBONE2`, `PTOYX0`, `PTOYX1`, `PTOYX2`, `PTOYY0`, `PTOYY1`, `PTOYY2`,\
	`PTOYZ0`, `PTOYZ1`, `PTOYZ2`, `PTOYRX0`, `PTOYRX1`, `PTOYRX2`, `PTOYRY0`, `PTOYRY1`, `PTOYRY2`, `PTOYRZ0`, `PTOYRZ1`, `PTOYRZ2`, `PTOYSX0`, `PTOYSX1`, `PTOYSX2`,\
	`PTOYSY0`, `PTOYSY1`, `PTOYSY2`, `PTOYSZ0`, `PTOYSZ1`, `PTOYSZ2`, ");
    strcat(DB_Query, DB_String);
    
    format(DB_String, 9O00, "`BOL1`, `BOL2`, `BOL3`, `BOL4`, `BOL5`, `BOL6`, `BOL7`, `BOL8`, `BOL9`, `BOL10`, `BOL11`, `BOL12`, `FACCION`, `TRABAJO`)");
    strcat(DB_Query, DB_String);
    db_query(Database, DB_Query);

    db_query(Database, "CREATE TABLE IF NOT EXISTS `VEHS` (`VKEY`, `VD`, `VPOSX`, `VPOSY`, `VPOSZ`, `VANGLE`, `VMODELID`, `VCOLOR1`, `VCOLOR2`, `VPAINTJOB`, `VM1`, `VM2`, `VM3`, `VM4`, `VM5`, `VM6`, `VM7`, `VM8`, `VM9`, `VM10`, `VM11`, `VM12`, `VM13`, `VM14`, `VM15`, `VM16`, `VM17`, `VSTATUS`, `VHEALTH`, `VPANELS`, `VDOORS`, `VLIGHTS`, `VTIRES`)");
	SetGameModeText("eXtreme Roleplay en espaсol");


Код:
        case DIALOG_REGISTER:
        {
            if(response)
            {
                new Query[1500], ip[16];
				GetPlayerIp(playerid, ip, sizeof(ip));
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registro", "Dejaste el campo vacнo, por favor\ningrese una contraseсa", "Reintentar", "Salir");
				if(strlen(inputtext) <= 2 || strlen(inputtext) >= 15) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Registro", "Ha ocurrido un error:\n\n\tLa contraseсa debe ser superior a 2 letras\n\te inferior a 16.\n\nVuele a intentarlo.", "Reintentar", "Salir");
				
				new str[24];
				format(Query, sizeof(Query), "INSERT INTO `USERS` ");
				strcat(Query, "(`NAME`,");
				strcat(Query, "`PASSWORD`,");
				strcat(Query, "`IP`,");
				strcat(Query, "`POSX`,");
				strcat(Query, "`POSY`,");
				strcat(Query, "`POSZ`,");
				strcat(Query, "`ANGLE`,");
				strcat(Query, "`INTERIORID`,");
				strcat(Query, "`BR`,");
				strcat(Query, "`EMAIL`,");
				strcat(Query, "`DINERO`,");
				strcat(Query, "`DINEROBANK`,");
				strcat(Query, "`SEXO`,");
				strcat(Query, "`EDAD`,");
				strcat(Query, "`SKIN`,");
				strcat(Query, "`VIDA`,");
				strcat(Query, "`CHALECO`,");
				strcat(Query, "`ADMLVL`,");
				strcat(Query, "`PHONENUMBER`,");
				strcat(Query, "`INTERIOR`,");
				strcat(Query, "`BANKA`,");
				strcat(Query, "`VBANK`,");
				strcat(Query, "`VGROTTI`,");
				strcat(Query, "`V247`,");
				strcat(Query, "`VROPA`,");
				strcat(Query, "`VFOOD`,");
				strcat(Query, "`DUDE`,");
				strcat(Query, "`WORK`,");
				strcat(Query, "`LVL`,");
				strcat(Query, "`VEH0`,");
				strcat(Query, "`VEH1`,");
				strcat(Query, "`VEH2`,");
				strcat(Query, "`VEH3`,");
				strcat(Query, "`VKEY0`,");
				strcat(Query, "`VKEY1`,");
				strcat(Query, "`VKEY2`,");
				strcat(Query, "`VKEY3`,");
				strcat(Query, "`PSTATUS`,");
				strcat(Query, "`PTOY0`,");
				strcat(Query, "`PTOY1`,");
				strcat(Query, "`PTOY2`,");
				strcat(Query, "`PTOYMID0`,");
				strcat(Query, "`PTOYMID1`,");
				strcat(Query, "`PTOYMID2`,");
				strcat(Query, "`PTOYBONE0`,");
				strcat(Query, "`PTOYBONE1`,");
				strcat(Query, "`PTOYBONE2`,");
				strcat(Query, "`PTOYX0`,");
				strcat(Query, "`PTOYX1`,");
				strcat(Query, "`PTOYX2`,");
				strcat(Query, "`PTOYY0`,");
				strcat(Query, "`PTOYY1`,");
				strcat(Query, "`PTOYY2`,");
				strcat(Query, "`PTOYZ0`,");
				strcat(Query, "`PTOYZ1`,");
				strcat(Query, "`PTOYZ2`,");
				strcat(Query, "`PTOYRX0`,");
				strcat(Query, "`PTOYRX1`,");
				strcat(Query, "`PTOYRX2`,");
				strcat(Query, "`PTOYRY0`,");
				strcat(Query, "`PTOYRY1`,");
				strcat(Query, "`PTOYRY2`,");
				strcat(Query, "`PTOYRZ0`,");
				strcat(Query, "`PTOYRZ1`,");
				strcat(Query, "`PTOYRZ2`,");
				strcat(Query, "`PTOYSX0`,");
				strcat(Query, "`PTOYSX1`,");
				strcat(Query, "`PTOYSX2`,");
				strcat(Query, "`PTOYSY0`,");
				strcat(Query, "`PTOYSY1`,");
				strcat(Query, "`PTOYSY2`,");
				strcat(Query, "`PTOYSZ0`,");
				strcat(Query, "`PTOYSZ1`,");
				strcat(Query, "`PTOYSZ2`,");
                strcat(Query, "`BOL1`,");
                strcat(Query, "`BOL2`,");
                strcat(Query, "`BOL3`,");
                strcat(Query, "`BOL4`,");
                strcat(Query, "`BOL5`,");
                strcat(Query, "`BOL6`,");
                strcat(Query, "`BOL7`,");
                strcat(Query, "`BOL8`,");
                strcat(Query, "`BOL9`,");
                strcat(Query, "`BOL10`,");
                strcat(Query, "`BOL11`,");
                strcat(Query, "`BOL12`,");
                strcat(Query, "`FACCION`,");
                strcat(Query, "`TRABAJO`)")
Код:
stock UpdateUserData(playerid)
{
	
 	new Query[2000], Float:p[4], Float:ha[2], name[MAX_PLAYER_NAME], str[64];
 	GetPlayerName(playerid, name, sizeof(name));
    GetPlayerHealth(playerid, ha[0]);
    GetPlayerArmour(playerid, ha[1]);
    GetPlayerPos(playerid, p[0], p[1], p[2]);
    GetPlayerFacingAngle(playerid, p[3]);
 

	format(str, 64, "UPDATE `USERS` SET "); strcat(Query, str);
 	format(str, 64, "`POSX` = '%f',",p[0]); strcat(Query, str);
 	format(str, 64, "`POSY` = '%f',",p[1]); strcat(Query, str);
 	format(str, 64, "`POSZ` = '%f',",p[2]); strcat(Query, str);
 	format(str, 64, "`ANGLE` = '%f',",p[3]); strcat(Query, str);
 	format(str, 64, "`INTERIORID` = '%d',",GetPlayerInterior(playerid)); strcat(Query, str);
 	format(str, 64, "`BR` = '%d',",PlayerInfo[playerid][bankt]); strcat(Query, str);
 	format(str, 64, "`EMAIL` = '%s',",PlayerInfo[playerid][email]); strcat(Query, str);
 	format(str, 64, "`DINERO` = '%d',",PlayerInfo[playerid][dinero]); strcat(Query, str);
 	format(str, 64, "`DINEROBANK` = '%d',",PlayerInfo[playerid][dinerobank]); strcat(Query, str);
    format(str, 64, "`SEXO` = '%d',",PlayerInfo[playerid][sexo]); strcat(Query, str);
    format(str, 64, "`EDAD` = '%d',",PlayerInfo[playerid][edad]); strcat(Query, str);
    format(str, 64, "`SKIN` = '%d',",PlayerInfo[playerid][skin]); strcat(Query, str);
    format(str, 64, "`VIDA` = '%f',",ha[0]); strcat(Query, str);
    format(str, 64, "`CHALECO` = '%f',",ha[1]); strcat(Query, str);
    format(str, 64, "`ADMLVL` = '%d',",PlayerInfo[playerid][admlvl]); strcat(Query, str);
    format(str, 64, "`PHONENUMBER` = '%d',",PlayerInfo[playerid][phonenumber]); strcat(Query, str);
    format(str, 64, "`INTERIOR` = '%d',",PlayerInfo[playerid][Interior]); strcat(Query, str);
    format(str, 64, "`BANKA` = '%d',",PlayerInfo[playerid][BankA]); strcat(Query, str);
    format(str, 64, "`VBANK` = '%d',",PlayerInfo[playerid][VBank]); strcat(Query, str);
    format(str, 64, "`VGROTTI` = '%d',",PlayerInfo[playerid][VGrotti]); strcat(Query, str);
    format(str, 64, "`V247` = '%d',",PlayerInfo[playerid][V247]); strcat(Query, str);
    format(str, 64, "`VROPA` = '%d',",PlayerInfo[playerid][VRopa]); strcat(Query, str);
    format(str, 64, "`VFOOD` = '%d',",PlayerInfo[playerid][VComida]); strcat(Query, str);
    format(str, 64, "`DUDE` = '%d',",PlayerInfo[playerid][DudeChannel]); strcat(Query, str);
    format(str, 64, "`WORK` = '%d',",PlayerInfo[playerid][Work]); strcat(Query, str);
    format(str, 64, "`LVL` = '%d',",PlayerInfo[playerid][Plevel]); strcat(Query, str);//aka estatodoo
    format(str, 64, "`VEH0` = '%d',",PlayerInfo[playerid][PlayerVehicle][0]); strcat(Query, str);
    format(str, 64, "`VEH1` = '%d',",PlayerInfo[playerid][PlayerVehicle][1]); strcat(Query, str);
    format(str, 64, "`VEH2` = '%d',",PlayerInfo[playerid][PlayerVehicle][2]); strcat(Query, str);
    format(str, 64, "`VEH3` = '%d',",PlayerInfo[playerid][PlayerVehicle][3]); strcat(Query, str);
    format(str, 64, "`VKEY0` = '%d',",PlayerInfo[playerid][PlayerVehicleKey][0]); strcat(Query, str);
    format(str, 64, "`VKEY1` = '%d',",PlayerInfo[playerid][PlayerVehicleKey][1]); strcat(Query, str);
    format(str, 64, "`VKEY2` = '%d',",PlayerInfo[playerid][PlayerVehicleKey][2]); strcat(Query, str);
    format(str, 64, "`VKEY3` = '%d',",PlayerInfo[playerid][PlayerVehicleKey][3]); strcat(Query, str);
    format(str, 64, "`PSTATUS` = '%d',",PlayerInfo[playerid][PlayerStatus]); strcat(Query, str);
    format(str, 64, "`PTOY0` = '%d',",PlayerInfo[playerid][pToy][0]); strcat(Query, str);
    format(str, 64, "`PTOY1` = '%d',",PlayerInfo[playerid][pToy][1]); strcat(Query, str);
    format(str, 64, "`PTOY2` = '%d',",PlayerInfo[playerid][pToy][2]); strcat(Query, str);
    format(str, 64, "`PTOYMID0` = '%d',",PlayerInfo[playerid][pToyModelID][0]); strcat(Query, str);
    format(str, 64, "`PTOYMID1` = '%d',",PlayerInfo[playerid][pToyModelID][1]); strcat(Query, str);
    format(str, 64, "`PTOYMID2` = '%d',",PlayerInfo[playerid][pToyModelID][2]); strcat(Query, str);
    format(str, 64, "`PTOYBONE0` = '%d',",PlayerInfo[playerid][pToyBone][0]); strcat(Query, str);
    format(str, 64, "`PTOYBONE1` = '%d',",PlayerInfo[playerid][pToyBone][1]); strcat(Query, str);
    format(str, 64, "`PTOYBONE2` = '%d',",PlayerInfo[playerid][pToyBone][2]); strcat(Query, str);
    format(str, 64, "`PTOYX0` = '%f',",PlayerInfo[playerid][pToyX][0]); strcat(Query, str);
    format(str, 64, "`PTOYX1` = '%f',",PlayerInfo[playerid][pToyX][1]); strcat(Query, str);
    format(str, 64, "`PTOYX2` = '%f',",PlayerInfo[playerid][pToyX][2]); strcat(Query, str);
    format(str, 64, "`PTOYY0` = '%f',",PlayerInfo[playerid][pToyY][0]); strcat(Query, str);
    format(str, 64, "`PTOYY1` = '%f',",PlayerInfo[playerid][pToyY][1]); strcat(Query, str);
    format(str, 64, "`PTOYY2` = '%f',",PlayerInfo[playerid][pToyY][2]); strcat(Query, str);
    format(str, 64, "`PTOYZ0` = '%f',",PlayerInfo[playerid][pToyZ][0]); strcat(Query, str);
    format(str, 64, "`PTOYZ1` = '%f',",PlayerInfo[playerid][pToyZ][1]); strcat(Query, str);
    format(str, 64, "`PTOYZ2` = '%f',",PlayerInfo[playerid][pToyZ][2]); strcat(Query, str);
    format(str, 64, "`PTOYRX0` = '%f',",PlayerInfo[playerid][pToyRX][0]); strcat(Query, str);
    format(str, 64, "`PTOYRX1` = '%f',",PlayerInfo[playerid][pToyRX][1]); strcat(Query, str);
    format(str, 64, "`PTOYRX2` = '%f',",PlayerInfo[playerid][pToyRX][2]); strcat(Query, str);
    format(str, 64, "`PTOYRY0` = '%f',",PlayerInfo[playerid][pToyRY][0]); strcat(Query, str);
    format(str, 64, "`PTOYRY1` = '%f',",PlayerInfo[playerid][pToyRY][1]); strcat(Query, str);
    format(str, 64, "`PTOYRY2` = '%f',",PlayerInfo[playerid][pToyRY][2]); strcat(Query, str);
    format(str, 64, "`PTOYRZ0` = '%f',",PlayerInfo[playerid][pToyRZ][0]); strcat(Query, str);
    format(str, 64, "`PTOYRZ1` = '%f',",PlayerInfo[playerid][pToyRZ][1]); strcat(Query, str);
    format(str, 64, "`PTOYRZ2` = '%f',",PlayerInfo[playerid][pToyRZ][2]); strcat(Query, str);
    format(str, 64, "`PTOYSX0` = '%f',",PlayerInfo[playerid][pToySX][0]); strcat(Query, str);
    format(str, 64, "`PTOYSX1` = '%f',",PlayerInfo[playerid][pToySX][1]); strcat(Query, str);
    format(str, 64, "`PTOYSX2` = '%f',",PlayerInfo[playerid][pToySX][2]); strcat(Query, str);
    format(str, 64, "`PTOYSY0` = '%f',",PlayerInfo[playerid][pToySY][0]); strcat(Query, str);
    format(str, 64, "`PTOYSY1` = '%f',",PlayerInfo[playerid][pToySY][1]); strcat(Query, str);
    format(str, 64, "`PTOYSY2` = '%f',",PlayerInfo[playerid][pToySY][2]); strcat(Query, str);
    format(str, 64, "`PTOYSZ0` = '%f',",PlayerInfo[playerid][pToySZ][0]); strcat(Query, str);
    format(str, 64, "`PTOYSZ1` = '%f',",PlayerInfo[playerid][pToySZ][1]); strcat(Query, str);
    format(str, 64, "`PTOYSZ2` = '%f',",PlayerInfo[playerid][pToySZ][2]); strcat(Query, str);
    format(str, 64, "`BOL1` = '%d',",BolsilloID[playerid][1]); strcat(Query, str);
    format(str, 64, "`BOL2` = '%d',",BolsilloID[playerid][2]); strcat(Query, str);
    format(str, 64, "`BOL3` = '%d',",BolsilloID[playerid][3]); strcat(Query, str);
    format(str, 64, "`BOL4` = '%d',",BolsilloID[playerid][4]); strcat(Query, str);
    format(str, 64, "`BOL5` = '%d',",BolsilloID[playerid][5]); strcat(Query, str);
    format(str, 64, "`BOL6` = '%d',",BolsilloID[playerid][6]); strcat(Query, str);
    format(str, 64, "`BOL7` = '%d',",BolsilloID[playerid][7]); strcat(Query, str);
    format(str, 64, "`BOL8` = '%d',",BolsilloID[playerid][8]); strcat(Query, str);
    format(str, 64, "`BOL9` = '%d',",BolsilloID[playerid][9]); strcat(Query, str);
    format(str, 64, "`BOL10` = '%d',",BolsilloID[playerid][10]); strcat(Query, str);
    format(str, 64, "`BOL11` = '%d',",BolsilloID[playerid][11]); strcat(Query, str);
    format(str, 64, "`BOL12` = '%d'",BolsilloID[playerid][12]); strcat(Query, str);
    format(str, 64, "`FACCION` = '%d',",PlayerInfo[playerid][faccion]); strcat(Query, str);
    format(str, 64, "`TRABAJO` = '%d'",PlayerInfo[playerid][trabajo]); strcat(Query, str);
    format(str, 64, " WHERE `NAME` = '%s'",name); strcat(Query, str);
	db_query(Database, Query);
	return 1;
}
q I hope you can help me
Reply


Messages In This Thread
help sqlite - by capottematias - 08.03.2015, 21:04
Re: help sqlite - by Passmerd - 08.03.2015, 21:55
Re: help sqlite - by PT - 08.03.2015, 22:52

Forum Jump:


Users browsing this thread: 2 Guest(s)