player.UniqueID Null

Started by Nihongo^, Dec 19, 2017, 07:39 AM

Previous topic - Next topic

Nihongo^

When i register it shows Null on uniqid



here's the functio

function Register( player, password )
{
QuerySQL(db, "INSERT INTO Accounts ( Name, LastIPUsed, Level, Password, Kills, Deaths, Cash, Bank, Joins, Datereg, Randspawn, Nogoto, VIPLevel, UID, Gems, GemsRange, VehiclesOwned, Clan, Headshots, Timeplayed, Cskinowner ) VALUES ( '"+player.Name+"', '"+player.IP+"', '1', '"+password+"', '0', '0', '0', '0', '0', '"+GetFullTime()+"', 'off', 'off', '0', '"+player.UniqueID+"', '0', '0', '0', 'none', '0', '0', 'false' )" );

}

umar4911

Use this
function Register( player, password )
{
 QuerySQL(db, "INSERT INTO Accounts ( Name, LastIPUsed, Level, Password, Kills, Deaths, Cash, Bank, Joins, Datereg, Randspawn, Nogoto, VIPLevel, UID, Gems, GemsRange, VehiclesOwned, Clan, Headshots, Timeplayed, Cskinowner ) VALUES ( '"+player.Name+"', '"+player.IP+"', '1', '"+password+"', '0', '0', '0', '0', '0', '"+GetFullTime()+"', 'off', 'off', '0', '"+player.UID+"', '0', '0', '0', 'none', '0', '0', 'false' )" );

}







RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter

Nihongo^

Quote from: umar4911 on Dec 19, 2017, 07:43 AMUse this
function Register( player, password )
{
 QuerySQL(db, "INSERT INTO Accounts ( Name, LastIPUsed, Level, Password, Kills, Deaths, Cash, Bank, Joins, Datereg, Randspawn, Nogoto, VIPLevel, UID, Gems, GemsRange, VehiclesOwned, Clan, Headshots, Timeplayed, Cskinowner ) VALUES ( '"+player.Name+"', '"+player.IP+"', '1', '"+password+"', '0', '0', '0', '0', '0', '"+GetFullTime()+"', 'off', 'off', '0', '"+player.UID+"', '0', '0', '0', 'none', '0', '0', 'false' )" );

}
Sorry not Work

!

Quote from: umar4911 on Dec 19, 2017, 07:43 AMUse this
function Register( player, password )
{
 QuerySQL(db, "INSERT INTO Accounts ( Name, LastIPUsed, Level, Password, Kills, Deaths, Cash, Bank, Joins, Datereg, Randspawn, Nogoto, VIPLevel, UID, Gems, GemsRange, VehiclesOwned, Clan, Headshots, Timeplayed, Cskinowner ) VALUES ( '"+player.Name+"', '"+player.IP+"', '1', '"+password+"', '0', '0', '0', '0', '0', '"+GetFullTime()+"', 'off', 'off', '0', '"+player.UID+"', '0', '0', '0', 'none', '0', '0', 'false' )" );

}

http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Player.UniqueID

Discord: zeus#5155

Nihongo^

Quote from: ! on Dec 19, 2017, 01:08 PM
Quote from: umar4911 on Dec 19, 2017, 07:43 AMUse this
function Register( player, password )
{
 QuerySQL(db, "INSERT INTO Accounts ( Name, LastIPUsed, Level, Password, Kills, Deaths, Cash, Bank, Joins, Datereg, Randspawn, Nogoto, VIPLevel, UID, Gems, GemsRange, VehiclesOwned, Clan, Headshots, Timeplayed, Cskinowner ) VALUES ( '"+player.Name+"', '"+player.IP+"', '1', '"+password+"', '0', '0', '0', '0', '0', '"+GetFullTime()+"', 'off', 'off', '0', '"+player.UID+"', '0', '0', '0', 'none', '0', '0', 'false' )" );

}

http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Player.UniqueID
Its strange in Alias its showing the Clear Uniqe ID ( not null0xx ) but in accounts its bug
anyways iam using the same
+ player.UniqueID

!

Quote from: Nihongo^ on Dec 19, 2017, 01:13 PM
Quote from: ! on Dec 19, 2017, 01:08 PM
Quote from: umar4911 on Dec 19, 2017, 07:43 AMUse this
function Register( player, password )
{
 QuerySQL(db, "INSERT INTO Accounts ( Name, LastIPUsed, Level, Password, Kills, Deaths, Cash, Bank, Joins, Datereg, Randspawn, Nogoto, VIPLevel, UID, Gems, GemsRange, VehiclesOwned, Clan, Headshots, Timeplayed, Cskinowner ) VALUES ( '"+player.Name+"', '"+player.IP+"', '1', '"+password+"', '0', '0', '0', '0', '0', '"+GetFullTime()+"', 'off', 'off', '0', '"+player.UID+"', '0', '0', '0', 'none', '0', '0', 'false' )" );

}

http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Player.UniqueID
Its strange in Alias its showing the Clear Uniqe ID ( not null0xx ) but in accounts its bug
anyways iam using the same
+ player.UniqueID
Post the create table statement.

Discord: zeus#5155

Nihongo^

function CreateTables()
{
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Accounts ( Name VARACHAR(225), LastIPUsed VARACHAR(20), Level NUMERIC, Password VARACHR(255), Kills NUMERIC, Deaths NUMERIC, Cash NUMERIC, Bank NUMERIC, Joins NUMERIC, Datereg TEXT, Randspawn TEXT, Nogoto TEXT, VIPLevel NUMERIC)" );
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Bans ( Name VARCHAR(32), IP VARCHAR(25), Admin TEXT, Reason TEXT )" );
        QuerySQL(db, "CREATE TABLE IF NOT EXISTS Tempban( ban_nick TEXT, ban_ip TEXT, ban_time TEXT, ban_expire TEXT, ban_expireratio TEXT, ban_admin TEXT, ban_reason TEXT )" );
        QuerySQL(db, "CREATE TABLE IF NOT EXISTS lastjoin ( Name TEXT, Time NUMERIC )" );
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Spawnwep ( Name TEXT, Wep NUMERIC, Wep2 NUMERIC, Wep3 NUMERIC, Wep4 NUMERIC )" );
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Spawnloc ( Name VARACHAR(255), Position FLOAT )" );
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Locations( Name VARACHAR(255), Loc TEXT, Position FLOAT)" );
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Alias ( Name TEXT, IP VARCHAR(20), UID TEXT )" );
QuerySQL(vdb, "CREATE TABLE IF NOT EXISTS Vehicles ( Model INT, World INT, Posangle FLOAT, color INT)" );
QuerySQL(db, "CREATE TABLE IF NOT EXISTS ClanMembers ( Clan TEXT, Owner TEXT, Leader1 TEXT, Leader2 TEXT, Leader3 TEXT, Users TEXT  )" );
QuerySQL(db, "CREATE TABLE IF NOT EXISTS ClanStats ( Tag TEXT, Clan TEXT, Kills NUMERIC DEFAULT 0, Deaths NUMERIC DEFAULT 0, Deads NUMERIC DEFAULT 0 )" );
QuerySQL(db, "CREATE TABLE IF NOT EXISTS ClanMembersRequest ( Player TEXT, Tag TEXT, Clan TEXT, State TEXT )" );
QuerySQL(db, "CREATE TABLE IF NOT EXISTS ClanReports ( Clan TEXT, Member TEXT, Reporter TEXT, Reason TEXT, Date_Of_Report TEXT )" );
       

//Reports Table
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Reports ( Reporter VARACHAR(255), Player VARACHAR(255), Reason TEXT, Date TEXT )" );

// Badges Table
QuerySQL(db, "CREATE TABLE IF NOT EXISTS Badges( Name VARACHAR(255), Badge TEXT )" );

//Alters the Accounts table.
QuerySQL(db, "ALTER TABLE Accounts ADD UID VARACHAR(255)" ); //13
QuerySQL(db, "ALTER TABLE Accounts ADD Gems VARACHAR(255)" ); //14
QuerySQL(db, "ALTER TABLE Accounts ADD GemsRange VARACHAR(255)" ); //15
QuerySQL(db, "ALTER TABLE Accounts ADD VehiclesOwned NUMERIC " ); //16
QuerySQL(db, "ALTER TABLE Accounts ADD Clan TEXT " ); //17
        QuerySQL(db, "ALTER TABLE Accounts ADD Headshots NUMERIC DEFAULT 0" ); //18
        QuerySQL(db, "ALTER TABLE Accounts ADD Timeplayed NUMERIC DEFAULT 0" ); //19
QuerySQL(db, "ALTER TABLE Accounts ADD Cskinowner TEXT DEFAULT false" ); //20
       
       

// Alters Vehicles Table
QuerySQL(vdb, "ALTER TABLE Vehicles ADD VehOwner TEXT " );
QuerySQL(vdb, "ALTER TABLE Vehicles ADD VehCost NUMERIC " );
QuerySQL(vdb, "ALTER TABLE Vehicles ADD SharedWith VARACHAR(255) " );
QuerySQL(vdb, "ALTER TABLE Vehicles ADD VehID NUMERIRC" );
}

!

I am out from here caause there's not any problem might be you are updating the UID in some where else in your script.
Might be the UID is updated as null in any one of the bellow event
onplayerJoin();
onplayerSpawn(); // might be if copy paste is used
onplayerPart();

Better to post the lines in which the script updates the Account table in the above events.

Discord: zeus#5155