SQL 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: SQL help (
/showthread.php?tid=590373)
SQL help -
Hybris - 28.09.2015
Hello im trying to make a query where it will save the players position (float) but I dont know how to do it,I only got this so far.
Код:
db_query(Database, "CREATE TABLE IF NOT EXISTS users (userid INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(24) COLLATE NOCASE, password VARCHAR(129), admin INTEGER DEFAULT 0 NOT NULL
How do I make it create the players float I know I have to add X,Y,Z but im not sure how I am supposed to do it.
Re: SQL help -
Ritzy2K - 28.09.2015
Save player's x,y,z coords as decimal data type? (Int wont work. Coords will be float)
Re: SQL help -
PrO.GameR - 28.09.2015
Creating tables with pawn is unnecessarily hard, simply do it with phpmyadmin, export it right after so it stays empty and intact so you can import it later, if you absolutely wanna do it thru pawn, use
Код:
X FLOAT (length,decimals),Y FLOAT (length,decimals),Z FLOAT (length,decimals),
I use (12,6) since 6 decimals is all I need in precision, 12,6 means 6 of them are decimals, 6 of them are length of rest, like from -123456.123456 to 123456.123456
(actually I'm not sure whats highest X Y Z cord in sa-mp, is 6 enough ?)