Vice Underdogs

Scripting => Script Showroom => Topic started by: MaDKilleR on March 20, 2012, 09:43:43 am

Title: Account System
Post by: MaDKilleR on March 20, 2012, 09:43:43 am
Account System

An Account System Script written by me. Data is stored in a SQL DataBase. Passwords are encrypted ( STORM256 Encryption (http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=472.0) Credits to [VU]Stormeus )

Commands Included:
 /c register, /c login.





Download: Clicky! (http://www.mediafire.com/?654cdr5yn4pczb3)



Title: Re: Account System
Post by: Zeke on March 20, 2012, 10:18:40 am
Very nice, but I think ur missing a GetBankCash function  :P :D

PS: The download button is just EPIC!
Title: Re: Account System
Post by: MaDKilleR on March 20, 2012, 10:27:26 am
Very nice, but I think ur missing a GetBankCash function  :P :D

PS: The download button is just EPIC!

Updated :D
Title: Re: Account System
Post by: Thijn on March 20, 2012, 03:46:32 pm
Oh god. I suggest everyone not use this script..

This is just the worst a sqlite script can get.
With bad I mean this bad:
Code: [Select]
function SetLogged( player, status )
{
    QuerySQL( db, format( "UPDATE Accounts SET Logged='%s' WHERE Name='" + player.Name + "'", status ) );
}

function SetIPLogged( player, sameip )
{
    QuerySQL( db, format( "UPDATE Accounts SET IP='%s' WHERE Name='" + player.Name + "'", sameip ) );
}

function GetPlayerIP( player )
{
    local IP = GetSQLColumnData( QuerySQL( db, "SELECT IP FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( IP ) return IP;
        else return 0;
}

function GetLevel( player )
{
    local lvl = GetSQLColumnData( QuerySQL( db, "SELECT Level FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( lvl ) return lvl;
        else return 0;
}

function GetCash( player )
{
    local cash = GetSQLColumnData( QuerySQL( db, "SELECT Cash FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( cash ) return cash;
        else return 0;
}

function GetBankCash( player )
{
    local cash = GetSQLColumnData( QuerySQL( db, "SELECT BankCash FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( cash ) return cash;
        else return 0;
}

function GetPass( player )
{
    local pass = GetSQLColumnData( QuerySQL( db, "SELECT Pass FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( pass ) return pass;
        else return 0;
}

function GetLogged( player )
{
    local log = GetSQLColumnData( QuerySQL( db, "SELECT Logged FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( log ) return log;
        else return 0;
}
Never, NEVER, use sqlite to store sessions or stuff like that. That's where squirrel and his Classes/tables/arrays kicks in.
Title: Re: Account System
Post by: MaDKilleR on March 20, 2012, 03:54:52 pm
Oh god. I suggest everyone not use this script..

This is just the worst a sqlite script can get.
With bad I mean this bad:
Code: [Select]
function SetLogged( player, status )
{
    QuerySQL( db, format( "UPDATE Accounts SET Logged='%s' WHERE Name='" + player.Name + "'", status ) );
}

function SetIPLogged( player, sameip )
{
    QuerySQL( db, format( "UPDATE Accounts SET IP='%s' WHERE Name='" + player.Name + "'", sameip ) );
}

function GetPlayerIP( player )
{
    local IP = GetSQLColumnData( QuerySQL( db, "SELECT IP FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( IP ) return IP;
        else return 0;
}

function GetLevel( player )
{
    local lvl = GetSQLColumnData( QuerySQL( db, "SELECT Level FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( lvl ) return lvl;
        else return 0;
}

function GetCash( player )
{
    local cash = GetSQLColumnData( QuerySQL( db, "SELECT Cash FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( cash ) return cash;
        else return 0;
}

function GetBankCash( player )
{
    local cash = GetSQLColumnData( QuerySQL( db, "SELECT BankCash FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( cash ) return cash;
        else return 0;
}

function GetPass( player )
{
    local pass = GetSQLColumnData( QuerySQL( db, "SELECT Pass FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( pass ) return pass;
        else return 0;
}

function GetLogged( player )
{
    local log = GetSQLColumnData( QuerySQL( db, "SELECT Logged FROM Accounts WHERE Name='" + player.Name + "'" ), 0 );
if ( log ) return log;
        else return 0;
}
Never, NEVER, use sqlite to store sessions or stuff like that. That's where squirrel and his Classes/tables/arrays kicks in.

Thankx for your Tip.  :D