April 16, 2024, 12:51:35 pm

Author Topic: Account System  (Read 1361 times)

0 Members and 1 Guest are viewing this topic.

MaDKilleR

  • Vice Underdog
  • Crazy Man
  • *
  • Posts: 1518
  • Country: ca
  • Hi.
    • View Profile
    • MaDKiLLeR's Site
Account System
« 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 Credits to [VU]Stormeus )

Commands Included:
 /c register, /c login.





Download: Clicky!



« Last Edit: March 20, 2012, 10:30:40 am by MaDKilleR »
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

- [VU]MaDKiLLeR

Zeke

  • Crazy Man
  • *****
  • Posts: 935
  • Country: bg
  • VC:MP and LU beta tester
    • View Profile
Re: Account System
« Reply #1 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!
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Quote
InstallHook(0x405AC0,(DWORD)CantFindFuckingAnim,0x405A95,
CantFindFuckingAnim_HookJmpCode,sizeof(CantFindFuckingAnim_HookJmpCode));
-------------------------------------------------
Quote
[00:41:12] <~Murdock> actually just transfering files
[00:41:16] <~Murdock> sounds, clientscripts etc
[00:42:05] <heekzs> what transfer method you uses
[00:43:03] <~Murdock> speed of light

MaDKilleR

  • Vice Underdog
  • Crazy Man
  • *
  • Posts: 1518
  • Country: ca
  • Hi.
    • View Profile
    • MaDKiLLeR's Site
Re: Account System
« Reply #2 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
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

- [VU]MaDKiLLeR

Thijn

  • Forum Administrator
  • Crazy Man
  • *
  • *
  • *
  • Posts: 2946
  • Country: nl
    • View Profile
Re: Account System
« Reply #3 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.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

I'm not totally useless,
I can be used as an bad example ;)

"Never do Today, What you can do Tomorrow"


MaDKilleR

  • Vice Underdog
  • Crazy Man
  • *
  • Posts: 1518
  • Country: ca
  • Hi.
    • View Profile
    • MaDKiLLeR's Site
Re: Account System
« Reply #4 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
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

- [VU]MaDKiLLeR