SA-MP Forums Archive
Small question - 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: Small question (/showthread.php?tid=576726)



Small question - DarkLored - 06.06.2015

Hello, so I follows Konstanios tutorial on how to make a sqllite based account system, so I have added a few things to it but I have a problem. I am trying to save someones birthplace which he will write upon register but I don't know if it is possible to as a blank string or an integer in OnGameModeInit, and I don't know in the db_query to save it as a integer or a string if it is even possible, the point of this is to allow the player to write his own birthplace upon register but I can't really figure it out.


Re: Small question - Konstantinos - 06.06.2015

I don't understand what the problem is. If you have already created a database and you want to add a column, then use either a SQLite Database Browser or execute a query once:
pawn Код:
// syntax:
"ALTER TABLE table_name ADD column_name datatype"
Isn't birthplace supposed to be a text? The answer is the answer to your question about what to use.


Re: Small question - DarkLored - 06.06.2015

I'm recreating the whole thing, and yes the birthplace is suppose to be a text the problems is I don't know how to put it in the db_query for example "birthplace STRING DEFAULT n/a NOT NULL" or "birthplace VARCHAR(24)"?


Re: Small question - Konstantinos - 06.06.2015

VARCHAR as it's string and replace 24 with the max length the birthplace can have. If it's obligatory for a player to enter their birthplace, then you may want to specify NOT NULL as well.