SA-MP Forums Archive
SQLite small help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SQLite small help (/showthread.php?tid=576695)



SQLite small help - FailerZ - 06.06.2015

PHP код:
db_query(Database"CREATE TABLE IF NOT EXISTS Accounts (ID INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(24), Password VARCHAR(129), IP VARCHAR(16), Admin INTEGER DEFAULT 0 NOT NULL, Level INTEGER DEFAULT 1 NOT NULL, Skin INTEGER DEFAULT 108 NOT NULL, Money INTEGER DEFAULT 1000 NOT NULL, Health FLOAT DEFAULT 100.0 NOT NULL, Armour FLOAT DEFAULT 0.0 NOT NULL, LPosX FLOAT DEFAULT 0.0, LPosY FLOAT DEFAULT 0.0, LPosZ FLOAT DEFAULT 0.0, LFA FLOAT DEFAULT 0.0\
    , Dead INTEGER DEFAULT 0, DPosX FLOAT DEFAULT 0, DPosY FLOAT DEFAULT 0, DPosZ FLOAT DEFAULT 0)"
); 
So i got this query but the complier giving me error because it is too long.
I tried to split this and doesn't work as you see i even tried strcat but still giving errors.
Anyway to get rid of the long message errors
Or any other way to create this table?


Re: SQLite small help - JaydenJason - 06.06.2015

install zeex' pawn compiler patches, allows lines to be 4095 characters,

https://sampforum.blast.hk/showthread.php?pid=2768123#pid2768123


Re: SQLite small help - Konstantinos - 06.06.2015

The above suggestion is very good but I'll post how it'd be with strcat as you mentioned it gave you errors:
pawn Код:
new Query[535] =
"CREATE TABLE IF NOT EXISTS Accounts (ID INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(24), Password VARCHAR(129), IP VARCHAR(16), Admin INTEGER DEFAULT 0 NOT NULL, Level INTEGER DEFAULT 1 NOT NULL, ";
strcat(Query, "Skin INTEGER DEFAULT 108 NOT NULL, Money INTEGER DEFAULT 1000 NOT NULL, Health FLOAT DEFAULT 100.0 NOT NULL, Armour FLOAT DEFAULT 0.0 NOT NULL, LPosX FLOAT DEFAULT 0.0, LPosY FLOAT DEFAULT 0.0, ", sizeof (Query));
strcat(Query, "LPosZ FLOAT DEFAULT 0.0, LFA FLOAT DEFAULT 0.0, Dead INTEGER DEFAULT 0, DPosX FLOAT DEFAULT 0, DPosY FLOAT DEFAULT 0, DPosZ FLOAT DEFAULT 0)", sizeof (Query));



Re: SQLite small help - FailerZ - 06.06.2015

Quote:
Originally Posted by JaydenJason
Посмотреть сообщение
install zeex' pawn compiler patches, allows lines to be 4095 characters,

https://sampforum.blast.hk/showthread.php?pid=2768123#pid2768123
Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The above suggestion is very good but I'll post how it'd be with strcat as you mentioned it gave you errors:
pawn Код:
new Query[535] =
"CREATE TABLE IF NOT EXISTS Accounts (ID INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR(24), Password VARCHAR(129), IP VARCHAR(16), Admin INTEGER DEFAULT 0 NOT NULL, Level INTEGER DEFAULT 1 NOT NULL, ";
strcat(Query, "Skin INTEGER DEFAULT 108 NOT NULL, Money INTEGER DEFAULT 1000 NOT NULL, Health FLOAT DEFAULT 100.0 NOT NULL, Armour FLOAT DEFAULT 0.0 NOT NULL, LPosX FLOAT DEFAULT 0.0, LPosY FLOAT DEFAULT 0.0, ", sizeof (Query));
strcat(Query, "LPosZ FLOAT DEFAULT 0.0, LFA FLOAT DEFAULT 0.0, Dead INTEGER DEFAULT 0, DPosX FLOAT DEFAULT 0, DPosY FLOAT DEFAULT 0, DPosZ FLOAT DEFAULT 0)", sizeof (Query));
Thank you both for the help