SQL help
#1

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.
Reply
#2

Save player's x,y,z coords as decimal data type? (Int wont work. Coords will be float)
Reply
#3

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 ?)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)