So, I have been thinking about this system that loads up previous player position from SQLite database, and sets you there, but I encounter an error.
function PrecachePosition(player)
{
player.Skin = sqlite_column_data(sqlite_query(database, "SELECT Skin FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
/* local x = sqlite_column_data(sqlite_query(database, "SELECT * FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),1);
local y = sqlite_column_data(sqlite_query(database, "SELECT * FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),2);
local z = sqlite_column_data(sqlite_query(database, "SELECT * FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),3);*/
local wep = sqlite_column_data(sqlite_query(database, "SELECT Wep FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
local ammo = sqlite_column_data(sqlite_query(database, "SELECT Ammo FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
player.SetWeapon( wep, ammo );
player.Frozen = false;
player.Pos = Vector( sqlite_column_data(sqlite_query(database, "SELECT X FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0), sqlite_column_data(sqlite_query(database, "SELECT Y FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0), sqlite_column_data(sqlite_query(database, "SELECT Z FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0) );
}
1.YES the data exists
2.YES the data is in FLOAT format
3.YES the data is valid
4.YES the data is in NUMERIC.NUMERIC format ( FLOAT )
5.YES the data is saved at onPlayerPart(player,partreason)
6.YES I tried to get the exact data and put '.tofloat()' after it
7.The line with the error is surprisingly
player.Pos = Vector( sqlite_column_data(sqlite_query(database, "SELECT X FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0), sqlite_column_data(sqlite_query(database, "SELECT Y FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0), sqlite_column_data(sqlite_query(database, "SELECT Z FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0) );
Yes I also tried this code
local x = sqlite_column_data(sqlite_query(database, "SELECT X FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
local y = sqlite_column_data(sqlite_query(database, "SELECT Y FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
local z = sqlite_column_data(sqlite_query(database, "SELECT Z FROM LASTLOGIN WHERE Name='"+player.Name.toupper()+"' " ),0);
player.Pos = Vector( x.tofloat(), y.tofloat(), z.tofloat() );
also, when I make a class and default all the datas to null, then try to set them to 1, I receive a '' trying to set 'null ''
DO NOT COPY THIS CODE PLEASE