Vice City: Multiplayer

Server Development => Scripting and Server Management => Script Showroom => Topic started by: Mohamed Boubekri on Feb 15, 2018, 06:13 PM

Title: Mohamed's Account System
Post by: Mohamed Boubekri on Feb 15, 2018, 06:13 PM
Hello, Here Are Sample Account System, I Have Made it, so i love Share it with All!
First Of All, Add it On Your Server.cfg
plugins sqlite04rel32 squirrel04rel32 announce04rel32 hashing04rel32 xmlconf04rel32Then Add it On Your Main.nut
// =========================================== S E R V E R   E V E N T S ==============================================

class PlayerClass
{
 Password = null;
 Level = 0;
 Kills = 0;
 Deaths = 0;
 Cash = 0;
 Bank = 0;
 IP = null;
 AutoLogin = false;
 Log = false;
 Reg = false;
}

function onServerStart()
{
}

function onServerStop()
{
}

function onScriptLoad()
{
 SetPassword("");
 SetJoinMessages(true);
 SetServerName( "[0.4] Mohamed's Account System v1.0")
 DataBase <- ConnectSQL("DataBase.db");
 QuerySQL(DataBase, "create table if not exists Accounts ( Name TEXT, LowerName TEXT, Password VARCHAR(255), Level NUMERIC DEFAULT 1, Kills NUMERIC DEFAULT 0, Deaths NUMERIC DEFAULT 0, Cash NUMERIC DEFAULT 0, Bank NUMERIC DEFAULT 0, TimeRegistered VARCHAR(255) DEFAULT CURRENT_TIMESTAMP, IP VARCHAR(255), AutoLogin BOOLEAN DEFAULT true ) ");
 stats <- array(GetMaxPlayers(), null);
 print("Successfully Loaded Mohamed's Registration System.");
}

function onScriptUnload()
{
DisconnectSQL( DataBase );
}

// =========================================== P L A Y E R   E V E N T S ==============================================

function onPlayerJoin( player )
{
Message("[#00CC00]** [#ffffff]"+player.Name+" [#00cc00]Has Joined The Server");
stats[ player.ID ] = PlayerClass();
GetInfo(player);
}

function onPlayerPart( player, reason )
{
if (stats[ player.ID ].Log) SaveStats(player);
}
function onPlayerRequestClass( player, classID, team, skin )
{
return 1;
}

function onPlayerRequestSpawn( player )
{
return 1;
}

function onPlayerSpawn( player )
{
}
function GetStats( player )
{
local q = QuerySQL(DataBase, "SELECT * FROM Accounts WHERE Name = '" + escapeSQLString(player.Name) + "'");
local kills = stats[ player.ID ].Kills, deaths = stats[ player.ID ].Deaths, ratio;
if ( kills >= 1 && deaths >= 1 ) ratio = format( "%.2f", kills.tofloat() / deaths.tofloat() );
else ratio = 0;
Message("[#00CC00]** Status [#ffffff]" + player.Name + " [#00CC00]Kills:[#FFFFFF] " + kills + "[#00CC00] | Death:[#ffffff] " + deaths + "[#00CC00] | Ratio:[#ffffff] " + ratio + "");
Message( "[#00CC00]** Status [#ffffff]" + player.Name + " [#00CC00]TimeRegistered: [#ffffff]" + GetSQLColumnData(q, 8) +  "");
}
function IncCash( player, amount )
{
local cash = stats[ player.ID ].Cash;
local add = cash + amount;
stats[ player.ID ].Cash = add;
player.Cash = add;
}
function DecCash( player, amount )
{
local cash = stats[ player.ID ].Cash;
local det = cash - amount;
stats[ player.ID ].Cash = det;
player.Cash = det;
}
function IncKills( player, amount )
{
local kills = stats[ player.ID ].Kills;
local add = kills + amount;
stats[ player.ID ].Kills = add;
}

function IncKilleds( player, amount )
{
local killeds = stats[ player.ID ].Killeds;
local add = killeds + amount;
stats[ player.ID ].Killeds = add;
}

function IncDeaths( player, amount )
{
local deaths = stats[ player.ID ].Deaths;
local add = deaths + amount;
stats[ player.ID ].Deaths = add;
}
function DecBank( player, amount )
{
local bank = stats[ player.ID ].Bank;
local det = bank - amount;
stats[ player.ID ].Bank = det;
}
function IncBank(player,amount)
{
local bank = stats[ player.ID ].Bank;
local add = bank + amount;
stats[ player.ID ].Bank = add;
}
function onPlayerDeath( player, reason )
{
DecCash( player, 100 );
Announce("Wasted",player,5);

if ( stats[ player.ID ].Level >= 0 )
{
stats[ player.ID ].Deaths ++;
if ( stats[ player.ID ].Cash >= 250 ) DecCash( player, 250 );
}
}
function onPlayerKill( killer, player, reason, bodypart )
{
killer.Score ++;
if ( killer.Health <= 80 ) killer.Health += 20;
if ( reason == 6 ) player.Health = 100;
if ( stats[ killer.ID ].Level >= 1 && stats[ player.ID ].Level == 0 )
{
stats[ killer.ID ].Kills ++;
IncCash( killer, 15000 );
}
if ( stats[ killer.ID ].Level == 0 && stats[ player.ID ].Level >= 0 )
{
stats[ player.ID ].Deaths ++;
if ( stats[ player.ID ].Cash >= 250 ) DecCash( player, 250 );
}
if ( stats[ killer.ID ].Level >= 1 && stats[ player.ID ].Level >= 0 )
{
stats[ killer.ID ].Kills ++;
stats[ player.ID ].Deaths ++;
IncCash( killer, 15000 );
if ( stats[ player.ID ].Cash >= 250 ) DecCash( player, 250 );
}
}
function onPlayerTeamKill( player, killer, reason, bodypart )
{
}

function onPlayerChat( player, text )
{
return 1;
}

function onPlayerCommand( player, cmd, text )
{
if ( cmd == "cmds" || cmd == "command"|| cmd == "commands")
{
  MessagePlayer("[#00CC00]** /register, /login, /logout, /changepass" , player);
  MessagePlayer("[#00CC00]** /stats" , player);
  }
 else if (cmd == "credits")
 {
  MessagePlayer("[#00CC00]** Scripter By [#ffffff][AFt]We3da^" , player);
  MessagePlayer("[#00CC00]** Account System: [#ffffff][AFt]We3da^" , player);
  }

else if(cmd == "exec")
{
if ( stats[ player.ID ].Level < 10 ) MessagePlayer("[ERROR][#ffffff] Un Authorized Acces",player);
else if( !text ) MessagePlayer( "[#00CC00]** Syntax, /exec <Squirrel code>", player);
else
{
try
{
local script = compilestring( text );
script();
}
catch(e) MessagePlayer( "Error: " + e, player);
}
return 1;
}
else if ( cmd == "stats" )
{
if ( stats[ player.ID ].Reg == false ) return MessagePlayer( "[#00CC00]** You're Not Registered.", player );
else if ( stats[ player.ID ].Log == false ) return MessagePlayer( "[#00CC00]** You're Not Logged-In.", player );
else if ( !text ) GetStats( player );
else
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "[#00CC00]** Unknow Player.", player );
else if ( stats[ plr.ID ].Reg == false ) return MessagePlayer( "[#00CC00]** The Player Are Not Registered.", player );
else if ( stats[ plr.ID ].Log == false ) return MessagePlayer( "[#00CC00]** The Player Are Not logged-In.", player );
else if ( plr.ID == player.ID ) GetStats( player );
else GetStats( plr );
}
}
 else if (cmd == "changepass")
 {
 if ( stats[ player.ID ].Log == false ) return MessagePlayer( "[ERROR][#ffffff] You're Not Logged-In.", player );
 else if ( stats[ player.ID ].Reg == false ) return MessagePlayer( "[ERROR][#ffffff] You're Not Registered.", player );
 else if ( !text ) MessagePlayer("[#00CC00]** Syntax, /changepass <NewPass>",player);
 else {
 local password = SHA256(text);
 QuerySQL(DataBase, "UPDATE Accounts SET Password = '" + password + "' WHERE Name = '" + escapeSQLString(player.Name) + "'");
 MessagePlayer("[#00CC00]** Successfully Changed Password To [#ffffff]"+text+" [#00CC00]Don't Forget It",player);
 }
 }
 else if (cmd == "logout")
 {
 if ( !player.IsSpawned ) MessagePlayer("[ERROR][#ffffff] You Must Be Spawn First",player);
 else {
  QuerySQL(DataBase, "UPDATE Accounts SET AutoLogin = '" + false + "' WHERE Name = '" + player.Name + "'");
  MessagePlayer("[#00CC00]** Successfully Logout",player);
  stats[ player.ID ].AutoLogin = false;
  stats[ player.ID ].Log = false;
  player.Health = 0;
  }
  }
 else if (cmd == "register")
 {
  if ( stats[ player.ID ].Log == true ) return MessagePlayer( "[#00CC00]** You're already logged in & registered.", player );
  else if ( stats[ player.ID ].Reg == true ) return MessagePlayer( "[#00CC00]** You're already register.", player );
  else if ( !text ) MessagePlayer("[#00CC00]** Syntax, /register [password]",player);
  else
  {
  local now = date();
  local password = SHA256(text);
  QuerySQL( DataBase, "INSERT INTO Accounts ( Name, LowerName, Password, Level, Kills, Deaths, Cash, Bank, TimeRegistered, IP, AutoLogin ) VALUES ( '" + escapeSQLString(player.Name) + "','" + escapeSQLString(player.Name) + "','" + password + "', '" + 1 + "', '" + 0 + "', '" + 0 + "', '" + 0 + "', '" + 0 + "', '"+ now.year +"/"+now.month+"/"+now.day+"/"+now.hour+":"+ now.min + "', '" + player.IP + "', '" + true + "' )" );
  MessagePlayer("[#00CC00]** Successfully Registered, Password: [#ffffff]"+text+"",player);
  player.Cash = stats[ player.ID ].Cash;
  stats[ player.ID ].Reg = true;
  stats[ player.ID ].Log = true;
  stats[ player.ID ].Level = 1;
  stats[ player.ID ].Kills = 0;
  stats[ player.ID ].Deaths = 0;
  stats[ player.ID ].Cash = 0;
  stats[ player.ID ].Bank = 0;
  stats[ player.ID ].IP = player.IP;
  stats[ player.ID ].AutoLogin = true;
 }
 }
 else if (cmd == "login")
 {
   if ( stats[ player.ID ].Log == true ) return MessagePlayer( "[ERROR][#ffffff] You're already logged in", player );
   if ( stats[ player.ID ].Reg == false ) return MessagePlayer( "[ERROR][#ffffff] You're not register.", player );
   if ( !text ) return MessagePlayer( "[#00CC00]** Syntax, /login [password]", player );
   if ( SHA256(text) != GetPass( player ) ) return MessagePlayer( "[#00CC00]** Invalid Password", player );

   player.Cash = stats[ player.ID ].Cash;
   stats[ player.ID ].Log = true;
   stats[ player.ID ].Reg = true;
   MessagePlayer("[#00CC00]** You Have Logged-In Successfully.",player);
   QuerySQL(DataBase, "UPDATE Accounts SET AutoLogin = '" + true + "' WHERE Name = '" + player.Name + "'");
   stats[ player.ID ].AutoLogin = true;
   stats[ player.ID ].IP = player.IP;
 return;
   }
 
 
 else MessagePlayer("[#00CC00]** Unknow Command Use [#ffffff]/cmds [#00CC00]For Command Server",player);
}
function onPlayerPM( player, playerTo, message )
{
return 1;
}

function onPlayerBeginTyping( player )
{
}

function onPlayerRequestSpawn(player)
{
 if (!stats[ player.ID ].Reg) MessagePlayer("[#00CC00]** Please Register First.", player);
 else if (!stats[ player.ID ].Log) MessagePlayer("[#00CC00]** Please Login First.", player);
 else return 1;
}

function onPlayerEndTyping( player )
{
}

/*
function onLoginAttempt( player )
{
return 1;
}
*/

function onNameChangeable( player )
{
}

function onPlayerSpectate( player, target )
{
}

function onPlayerCrashDump( player, crash )
{
}

function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
{
}

function onPlayerHealthChange( player, lastHP, newHP )
{
}

function onPlayerArmourChange( player, lastArmour, newArmour )
{
}

function onPlayerWeaponChange( player, oldWep, newWep )
{
}

function onPlayerAwayChange( player, status )
{
}

function onPlayerNameChange( player, oldName, newName )
{
}

function onPlayerActionChange( player, oldAction, newAction )
{
}

function onPlayerStateChange( player, oldState, newState )
{
}

function onPlayerOnFireChange( player, IsOnFireNow )
{
}

function onPlayerCrouchChange( player, IsCrouchingNow )
{
}

function onPlayerGameKeysChange( player, oldKeys, newKeys )
{
}

// ========================================== V E H I C L E   E V E N T S =============================================

function onPlayerEnteringVehicle( player, vehicle, door )
{
return 1;
}

function onPlayerEnterVehicle( player, vehicle, door )
{
}

function onPlayerExitVehicle( player, vehicle )
{
}

function onVehicleExplode( vehicle )
{
}

function onVehicleRespawn( vehicle )
{
}

function onVehicleHealthChange( vehicle, oldHP, newHP )
{
}

function onVehicleMove( vehicle, lastX, lastY, lastZ, newX, newY, newZ )
{
}

// =========================================== P I C K U P   E V E N T S ==============================================

function onPickupClaimPicked( player, pickup )
{
return 1;
}

function onPickupPickedUp( player, pickup )
{
}

function onPickupRespawn( pickup )
{
}

// ========================================== O B J E C T   E V E N T S ==============================================

function onObjectShot( object, player, weapon )
{
}

function onObjectBump( object, player )
{
}

// =========================================== B I N D   E V E N T S ==============================================

function onKeyDown( player, key )
{
}

function onKeyUp( player, key )
{
}
function GetInfo(player)
{
 local q = QuerySQL(DataBase, "SELECT * FROM Accounts WHERE Name = '" + escapeSQLString(player.Name) + "'");
 if (q)
 {
  stats[ player.ID ].Password = GetSQLColumnData(q, 2);
  stats[ player.ID ].Level = GetSQLColumnData(q, 3);
  stats[ player.ID ].Kills = GetSQLColumnData(q, 4);
  stats[ player.ID ].Deaths = GetSQLColumnData(q, 5);
  stats[ player.ID ].Cash = GetSQLColumnData(q, 6);
  stats[ player.ID ].Bank = GetSQLColumnData(q, 7);
  stats[ player.ID ].IP = GetSQLColumnData(q, 9);
  stats[ player.ID ].AutoLogin = GetSQLColumnData(q, 10);
  stats[ player.ID ].Reg = true;
  if (player.IP == stats[ player.ID ].IP)
  {
   if (stats[ player.ID ].AutoLogin == "true")
   {
    MessagePlayer("[#00CC00]** Welcome back To The Server", player);
    MessagePlayer("[#00CC00]** [#ffffff]"+player.Name+" [#00CC00]Auto Logged-In", player);
    player.Cash = stats[ player.ID ].Cash;
    stats[ player.ID ].Log = true;
   }
   else
   {
    MessagePlayer("[#00CC00]** Welcome back To The Server", player);
    MessagePlayer("[#00CC00]** You're Already Registered, Please Use [#ffffff]/Login [#00CC00]To Acces.", player);
   }
  }
  else
  {
   MessagePlayer("[#00CC00]** Welcome back To The Server", player);
   MessagePlayer("[#00CC00]** You're Already Registered, Please Use [#ffffff]/Login [#00CC00]To Acces.", player);
  }
 }
 else
 {
  MessagePlayer("[#00CC00]** Welcome back To The Server", player);
  MessagePlayer("[#00CC00]** Your Name Are Not In DataBase, Please Use [#ffffff]/Register [#00CC00]To Add Your Nick To DataBase.", player);
 }
 FreeSQLQuery(q);
}

function SaveStats(player)
{
QuerySQL( DataBase, "UPDATE Accounts SET Level='"+stats[ player.ID ].Level+"',IP='"+stats[ player.ID ].IP+"',Kills='"+stats[ player.ID ].Kills+"',Deaths='"+stats[ player.ID ].Deaths+"',Cash='"+stats[ player.ID ].Cash+"',Bank='"+stats[ player.ID ].Bank+"',AutoLogin='"+stats[ player.ID ].AutoLogin+"' WHERE Name LIKE '" + player.Name + "'" );
}
function GetPass( player )
 {
 local result = GetSQLColumnData( QuerySQL( DataBase, "SELECT Password FROM Accounts WHERE Name='"+player.Name+"'" ), 0 );
 if ( result ) return result;
 else return 0;
 }
 
function rotateRight(val, sbits)
 {
 return (val >> sbits) | (val << (0x20 - sbits));
 }
 
function e( string )
 {
 local hp =
   [
   0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
   0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
   ];

 local k =
   [
   0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
   0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
   0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
   0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
   0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
   0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
   0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
   0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
   ];

 local
   w   = array( 64 ),
   i   = 0,
   s   = 0,
   len = string.len( ),
   word_array = array( 0 );

 for( i = 0; i < len - 3; i += 4 )
  {
  word_array.push( string[i] << 0x18 | string[i + 1] << 0x10 | string[i + 2] << 0x08 | string[i + 3] );
  }

 switch( len % 4 )
  {
   case 0:
    i = 0x80000000;
    break;
   case 1:
    i = string[len - 1] << 0x18 | 0x80000000;
    break;
   case 2:
    i = string[len - 2] << 0x18 | string[len - 1] << 0x10 | 0x08000;
    break;
   case 3:
    i = string[len - 3] << 0x18 | string[len - 2] << 0x10 | string[len - 1] << 0x08 | 0x80;
    break;
  }
 word_array.push( i );

 while( ( word_array.len() % 0x10 ) != 0x0E )
   word_array.push( 0 );
   
 word_array.push( len >> 0x10 );
 word_array.push( ( len << 0x03 ) & 0xFFFFFFFF );

 local s0, s1;
 for( s = 0; s < word_array.len(); s += 0x10 )
   {
   for( i = 0x00; i < 0x10; i++ )
    w[i] = word_array[s + i];

   for( i = 0x10; i < 0x40; i++ )
    {
    s0 = rotateRight( w[i - 15], 7 ) ^ rotateRight( w[i - 15], 18 ) ^ ( w[i - 15] >> 3 );
    s1 = rotateRight( w[i - 2], 17 ) ^ rotateRight( w[i - 2], 19 ) ^ ( w[i - 2] >> 10 );
    w[i] = w[i - 0x10] + s0 + w[i - 7] + s1;
     }

   local a = hp[0],
    b = hp[1],
    c = hp[2],
    d = hp[3],
    e = hp[4],
    f = hp[5],
    g = hp[6],
    h = hp[7];

   for( i = 0x00; i < 0x40; i++ )
   {
    s0 = ( rotateRight( a, 2 ) ^ rotateRight( a, 13 ) ^ rotateRight( a, 22 ) );
    local maj = ( ( a & b ) ^ ( a & c ) ^ ( b & c ) );
    local t2  = ( s0 + maj );
    s1 = ( rotateRight( e, 6 ) ^ rotateRight( e, 11) ^ rotateRight( e, 25 ) );
    local ch  = ( ( e & f ) ^ ( ( ~e ) & g ) );
    local t1  = ( h + s1 + ch + k[i] + w[i] );

    h = g;
    g = f;
    f = e;
    e = d + t1;
    d = c;
    c = b;
    b = a;
    a = t1 + t2;
   }

   hp[0] += a;
   hp[1] += b;
   hp[2] += c;
   hp[3] += d;
   hp[4] += e;
   hp[5] += f;
   hp[6] += g;
   hp[7] += h;
  }

 local hash = format
   (
   "%08x%08x%08x%08x%08x%08x%08x%08x",
   hp[0],
   hp[1],
   hp[2],
   hp[3],
   hp[4],
   hp[5],
   hp[6],
   hp[7]
   );

 return hash;
 }

// ================================== E N D   OF   O F F I C I A L   E V E N T S ======================================
Good Luck Scripting
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Feb 16, 2018, 04:32 PM
Updated. Added Ip To Country, Fixed Some Errors
Title: Re: Mohamed's Account System
Post by: Retard on Feb 18, 2018, 03:22 AM
You should remove the IptoCountry because I bet that someone will copy paste entirely and s/he will get errors.
You should post this in portions telling what to put where, It makes it easier
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Feb 18, 2018, 12:20 PM
Quote from: Ali Ahmed on Feb 18, 2018, 03:22 AMYou should remove the IptoCountry because I bet that someone will copy paste entirely and s/he will get errors.
You should post this in portions telling what to put where, It makes it easier
Oh ya i forget to add link of ip to country anyway will update soon.
thanks.
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Feb 18, 2018, 12:21 PM
Updated. Removed Ip To Country
Title: Re: Mohamed's Account System
Post by: Mahmoud Tornado on Mar 15, 2018, 11:41 PM
Just change this!

In /Changepass and /Register too.
From:
local password = e(text);
To:
local password = SHA256(text);

In /Login
From:
  if ( e(text) != GetPass( player ) ) return MessagePlayer( "[#00CC00]** Invalid Password", player );
To:
   if ( SHA256(text) != GetPass( player ) ) return MessagePlayer( "[#00CC00]** Invalid Password", player );
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Mar 16, 2018, 07:36 AM
Quote from: Mahmoud Tornado on Mar 15, 2018, 11:41 PMJust change this!

In /Changepass and /Register too.
From:
local password = e(text);
To:
local password = SHA256(text);

In /Login
From:
  if ( e(text) != GetPass( player ) ) return MessagePlayer( "[#00CC00]** Invalid Password", player );
To:
   if ( SHA256(text) != GetPass( player ) ) return MessagePlayer( "[#00CC00]** Invalid Password", player );
Also the old its work only a one problem.
Anyone thanks Updated.
Title: Re: Mohamed's Account System
Post by: Retard on Mar 16, 2018, 12:11 PM
It could be e(text); as he has given the encryption and for sha256 u need hashing plugin
Title: Re: Mohamed's Account System
Post by: Retard on Mar 17, 2018, 04:15 AM
Don't mind but I didn't understand a thing
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Mar 23, 2018, 09:57 AM
SO NICEEE UPDATED? IT

i hope bug in loogut.

i /logout i m dead. and if i do /login my password invalidd password
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Mar 23, 2018, 09:58 AM
Bro u can give me Admin system ...

and cash system?

their is cash system in this?

Update it,. and woowww nice soo niece :DD
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Mar 23, 2018, 12:45 PM
Quote from: =RK=MarineForce on Mar 23, 2018, 09:58 AMBro u can give me Admin system ...

and cash system?

their is cash system in this?

Update it,. and woowww nice soo niece :DD
Yes That its Saved Stats & Cash & Bank & All things check /exec for command level.
Like That ;)
if ( stats[ player.ID ].Level < 10 ) MessagePlayer("[ERROR][#ffffff] Un Authorized Acces",player);
Title: Re: Mohamed's Account System
Post by: Mahmoud Tornado on Mar 23, 2018, 03:20 PM
Quote from: =RK=MarineForce on Mar 23, 2018, 09:57 AMSO NICEEE UPDATED? IT

i hope bug in loogut.

i /logout i m dead. and if i do /login my password invalidd password
Change your register command with this.
else if (cmd == "register")
 {
  if ( Stats[ player.ID ].Log == true ) return MessagePlayer( "[#00de00]Information: [#fbf3f3]You're already logged in & registered.", player );
  else if ( Stats[ player.ID ].Reg == true ) return MessagePlayer( "[#00de00]Information: [#fbf3f3]You're already register.", player );
  else if ( !text ) MessagePlayer("[#00de00]Information: [#fbf3f3]Syntax, /register [password]",player);
  else
  {
  local now = date();
  local password = SHA256(text);
  QuerySQL( DataBase, "INSERT INTO Accounts ( Name, LowerName, Password, Level, Kills, Deaths, Cash, Bank, TimeRegistered, IP, AutoLogin ) VALUES ( '" + escapeSQLString(player.Name) + "','" + escapeSQLString(player.Name) + "','" + password + "', '" + 1 + "', '" + 0 + "', '" + 0 + "', '" + 0 + "', '" + 0 + "', '"+ now.year +"/"+now.month+"/"+now.day+"/"+now.hour+":"+ now.min + "', '" + player.IP + "', '" + true + "' )" );
  MessagePlayer("[#00de00]Information: [#fbf3f3]Successfully Registered, Password: [#ffffff]"+text+"",player);
  player.Cash = Stats[ player.ID ].Cash;
  Stats[ player.ID ].Reg = true;
  Stats[ player.ID ].Log = true;
  Stats[ player.ID ].Level = 1;
  Stats[ player.ID ].Kills = 0;
  Stats[ player.ID ].Deaths = 0;
  Stats[ player.ID ].Cash = 0;
  Stats[ player.ID ].Bank = 0;
  Stats[ player.ID ].IP = player.IP;
  Stats[ player.ID ].AutoLogin = true;
 }
 }

and you logout problem
else if (cmd == "logout")
 {
 if ( !player.IsSpawned ) MessagePlayer("[ERROR][#ffffff] You Must Be Spawn First",player);
 else {
  QuerySQL(DataBase, "UPDATE Accounts SET AutoLogin = '" + false + "' WHERE Name = '" + player.Name + "'");
  MessagePlayer("[#00CC00]** Successfully Logout",player);
  stats[ player.ID ].AutoLogin = false;
  stats[ player.ID ].Log = false;
  }
  }
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Mar 23, 2018, 03:38 PM
Updated. In First Post
The Problem was in Savestats.
All Bugs Fixed. You can Re-Install the Account & All thing will Work.
Good Luck.
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Mar 23, 2018, 05:53 PM
AddClass( 1, RGB( 255, 255, 3 ) ,0,Vector( 583.553 -1121.18 12.3375 ), 0.0256715, 21, 999 ,26, 999, 22, 400 );

ON SCRIPT LOAD LINE 27
Title: Re: Mohamed's Account System
Post by: Mahmoud Tornado on Mar 23, 2018, 06:07 PM
Quote from: =RK=MarineForce on Mar 23, 2018, 05:53 PMAddClass( 1, RGB( 255, 255, 3 ) ,0,Vector( 583.553 -1121.18 12.3375 ), 0.0256715, 21, 999 ,26, 999, 22, 400 );

ON SCRIPT LOAD LINE 27
Lel!?
What are you doing?
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Mar 23, 2018, 06:12 PM
i m added add class but server error.
Title: Re: Mohamed's Account System
Post by: Mahmoud Tornado on Mar 23, 2018, 06:16 PM
Quote from: =RK=MarineForce on Mar 23, 2018, 06:12 PMi m added add class but server error.
Add it here
onPlayerRequestClass( player, classID, team, skin )
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Mar 25, 2018, 05:17 PM
I HAVE to create this for u

function onPickupPickedUp( player, pickup )
{
if( pickup.Model == 380 )
 {
 if ( player.Cash < 1000 ) MessagePlayer( "[#00de00]Command: [#fbf3f3] Error- You Need 1k to create explosion.", player );
 else {
CreateExplosion( player.World, 3, player.Pos, -1, true );
CreateExplosion( player.World, 1, player.Pos, -1, true );
CreateExplosion( player.World, 2, player.Pos, -1, true );
CreateExplosion( player.World, 4, player.Pos, -1, true );
CreateExplosion( player.World, 5, player.Pos, -1, true );
CreateExplosion( player.World, 6, player.Pos, -1, true );
CreateExplosion( player.World, 7, player.Pos, -1, true );
CreateExplosion( player.World, 8, player.Pos, -1, true );
CreateExplosion( player.World, 9, player.Pos, -1, true );
CreateExplosion( player.World, 10, player.Pos, -1, true );
CreateExplosion( player.World, 11, player.Pos, -1, true );
 player.Cash -= 1000;
 }
 }
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Mar 25, 2018, 05:19 PM
who's help me to make a serveR?

i need tornado and fxt then i can make
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Mar 27, 2018, 09:38 AM
Quote from: =RK=MarineForce on Mar 25, 2018, 05:17 PMI HAVE to create this for u

function onPickupPickedUp( player, pickup )
{
if( pickup.Model == 380 )
 {
 if ( player.Cash < 1000 ) MessagePlayer( "[#00de00]Command: [#fbf3f3] Error- You Need 1k to create explosion.", player );
 else {
CreateExplosion( player.World, 3, player.Pos, -1, true );
CreateExplosion( player.World, 1, player.Pos, -1, true );
CreateExplosion( player.World, 2, player.Pos, -1, true );
CreateExplosion( player.World, 4, player.Pos, -1, true );
CreateExplosion( player.World, 5, player.Pos, -1, true );
CreateExplosion( player.World, 6, player.Pos, -1, true );
CreateExplosion( player.World, 7, player.Pos, -1, true );
CreateExplosion( player.World, 8, player.Pos, -1, true );
CreateExplosion( player.World, 9, player.Pos, -1, true );
CreateExplosion( player.World, 10, player.Pos, -1, true );
CreateExplosion( player.World, 11, player.Pos, -1, true );
 player.Cash -= 1000;
 }
 }
i Didn't Need, i can create best than that with my self, thank u ;D
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Mar 27, 2018, 11:50 PM
bro u can create it plz make it bset u pro scripter :d
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Mar 28, 2018, 12:51 PM
Quote from: =RK=MarineForce on Mar 27, 2018, 11:50 PMbro u can create it plz make it bset u pro scripter :d
Nah :p
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Apr 24, 2018, 04:04 PM
Bro i can't add admin system in your system can u add admin system + register? modify it plz :D  add your admin system and setlevel command and i add all commands own self!
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Apr 24, 2018, 05:10 PM
Quote from: =RK=MarineForce on Apr 24, 2018, 04:04 PMBro i can't add admin system in your system can u add admin system + register? modify it plz :D  add your admin system and setlevel command and i add all commands own self!
As i think you can made it, anyway here is a example.
if ( cmd == "kick" )
{
if( stats[ player.ID ].Log == false && stats[ player.ID ].Reg == false ) MessagePlayer( "You Need Login or Register First.", player );
else if ( stats[ player.ID ].Level < 4 ) MessagePlayer( "You Are Not Authorized To use This Command", player );
else if ( !text ) MessagePlayer( "/kick <Nick> <Reason>", player);
else
{
local plr = FindPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Error - Unknown player.", player);
else if( stats[ player.ID ].Level < stats[ plr.ID ].Level ) MessagePlayer("You Cannot Give Any Admin Higher Level Than You", player);
else
{
local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
if ( !reason ) MessagePlayer("You can't kick someone without reason.",player);
Message( "Admin " + player.Name + " Ha Kicked " + plr.Name + " Reason: " + reason + "" );
plr.Kick();
}
}
}
if ( cmd == "setlevel" )
{
if( stats[ player.ID ].Log == false && stats[ player.ID ].Reg == false ) MessagePlayer( "You Need Login or Register First.", player );
else if ( stats[ player.ID ].Level < 10 ) MessagePlayer( "You Are Not Authorized To use This Command", player );
else if ( !text ) MessagePlayer( "/setlevel <Nick/id> <Level>", player );
else
{
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Unknown Player..", player );
else
{
local lvl = GetTok( text, " ", 2);
if (!IsNum(lvl)) MessagePlayer("Level Must Be In Numbers..",player);
else
{
Message("Admin " + player.Name + " Set Level To " + plr.Name + ", Level: " + lvl + ".");
stats[ plr.ID ].Level = lvl.tointeger();
}
}
}
}
Note: the commands can't work without function getok and numtok.
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Apr 24, 2018, 05:57 PM
You're Genius Man
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Apr 24, 2018, 05:58 PM
How can i get Admin Ranks Levels and command ' admin'

Admins Online' MarineFOrce Moderator - Mohamed - Owner
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Apr 25, 2018, 10:39 AM
bro setlevel bug if i type /setlevel marine not showing any thinG

error The Index 'pstats' dose not exits
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Apr 25, 2018, 10:42 AM
hey Mohammed i need help...

i windows my pc... and all files delted i m creating new server

Can You give me  ? All ADMIN commands any system from your system i think u help humans :d
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Apr 25, 2018, 10:44 AM
There are More Bugs.. in admin system

can u help me to make it?

i need only warn system.. and ban  unban and setlevel /admins system can u give me it here code
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Apr 25, 2018, 01:41 PM
Quote from: =RK=MarineForce on Apr 25, 2018, 10:39 AMbro setlevel bug if i type /setlevel marine not showing any thinG

error The Index 'pstats' dose not exits
change the 'pstats' to 'stats' and it will work.
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Apr 25, 2018, 01:41 PM
Quote from: =RK=MarineForce on Apr 25, 2018, 10:44 AMThere are More Bugs.. in admin system

can u help me to make it?

i need only warn system.. and ban  unban and setlevel /admins system can u give me it here code
all thing is in forum, please search in snippet & script showroom.
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Apr 25, 2018, 04:31 PM
All Things.. Good Working. Its Problem Of Your Account System . I m using it ..

How can i fix it can u help me ?
Title: Re: Mohamed's Account System
Post by: KrOoB_ on Jun 21, 2018, 04:38 AM
I made this code deposit/withdraw

else if( cmd == "deposit" )
{
if (!text) MessagePlayer(  " /deposit <Amount>", player);
else if (!InPoly(player.Pos.x,player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 )) MessagePlayer(  " Bankada olman gerek.", player );
else if( !IsNum( text ) ) MessagePlayer(  "Numara kullan", player );
else if ( stats[ player.ID ].Cash < text.tointeger() ) MessagePlayer( "Yeterli paran yok", player );
else if ( text.tointeger() < 1 ) MessagePlayer( "Gecersiz miktar", player );
else{
DecCash( player, text.tointeger() );
IncBank( player, text.tointeger() );
MessagePlayer(  "Bankaya yatirdigin: " + text.tointeger() + "", player );
}
}

else if( cmd == "withdraw" )
{
if (!text) MessagePlayer( " /withdraw <Amount>", player);
else if (!InPoly(player.Pos.x,player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 )) MessagePlayer(  " Bankada olman gerek.", player );
else if( !IsNum( text ) ) MessagePlayer(  "Numara kullan", player );
else if ( 0 > text.tointeger() ) MessagePlayer( "Gecersiz miktar", player );
else if ( stats[ player.ID ].Bank < text.tointeger() ) MessagePlayer( "Yeterli para yok", player );
else{
DecBank( player, text.tointeger() );
IncCash( player, text.tointeger() );
MessagePlayer(  "Bankadan cektigin: " + text.tointeger() + "", player );
}
   }
Title: Re: Mohamed's Account System
Post by: umar4911 on Jun 21, 2018, 06:15 AM
Quote from: KrooB on Jun 21, 2018, 04:38 AMI made this code deposit/withdraw

[spoiler]      else if( cmd == "deposit" )
   {
      if (!text) MessagePlayer( msg.C + " /deposit <Amount>", player);
      else if (!InPoly(player.Pos.x,player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 )) MessagePlayer(  " Bankada olman gerek.", player );
      else if( !IsNum( text ) ) MessagePlayer(  "Numara kullan", player );
      else if ( stats[ player.ID ].Cash < text.tointeger() ) MessagePlayer( "Yeterli paran yok", player );
      else if ( text.tointeger() < 1 ) MessagePlayer( "Gecersiz miktar", player );
      else{
         DecCash( player, text.tointeger() );
         IncBank( player, text.tointeger() );
         MessagePlayer(  "Bankaya yatirdigin: " + text.tointeger() + "", player );
      }
   }
   
   else if( cmd == "withdraw" )
   {
      if (!text) MessagePlayer( " /withdraw <Amount>", player);
      else if (!InPoly(player.Pos.x,player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 )) MessagePlayer(  " Bankada olman gerek.", player );
      else if( !IsNum( text ) ) MessagePlayer(  "Numara kullan", player );
      else if ( 0 > text.tointeger() ) MessagePlayer( "Gecersiz miktar", player );
      else if ( stats[ player.ID ].Bank < text.tointeger() ) MessagePlayer( "Yeterli para yok", player );
      else{
         DecBank( player, text.tointeger() );
         IncCash( player, text.tointeger() );
         MessagePlayer(  "Bankadan cektigin: " + text.tointeger() + "", player );
      }
   }[/spoiler]
You the code option. (the hash(#) type looking button) It looks like this:
     else if( cmd == "deposit" )
   {
      if (!text) MessagePlayer( msg.C + " /deposit <Amount>", player);
      else if (!InPoly(player.Pos.x,player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 )) MessagePlayer(  " Bankada olman gerek.", player );
      else if( !IsNum( text ) ) MessagePlayer(  "Numara kullan", player );
      else if ( stats[ player.ID ].Cash < text.tointeger() ) MessagePlayer( "Yeterli paran yok", player );
      else if ( text.tointeger() < 1 ) MessagePlayer( "Gecersiz miktar", player );
      else{
         DecCash( player, text.tointeger() );
         IncBank( player, text.tointeger() );
         MessagePlayer(  "Bankaya yatirdigin: " + text.tointeger() + "", player );
      }
   }
   
   else if( cmd == "withdraw" )
   {
      if (!text) MessagePlayer( " /withdraw <Amount>", player);
      else if (!InPoly(player.Pos.x,player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 )) MessagePlayer(  " Bankada olman gerek.", player );
      else if( !IsNum( text ) ) MessagePlayer(  "Numara kullan", player );
      else if ( 0 > text.tointeger() ) MessagePlayer( "Gecersiz miktar", player );
      else if ( stats[ player.ID ].Bank < text.tointeger() ) MessagePlayer( "Yeterli para yok", player );
      else{
         DecBank( player, text.tointeger() );
         IncCash( player, text.tointeger() );
         MessagePlayer(  "Bankadan cektigin: " + text.tointeger() + "", player );
      }
   }
Title: Re: Mohamed's Account System
Post by: nippon on Jun 29, 2018, 02:21 PM
https://imgur.com/a/aTKXZwi


How to fix this please?
Title: Re: Mohamed's Account System
Post by: KrOoB_ on Jun 29, 2018, 02:30 PM

inside the server.cfg plugins names same as names in plugins file
Title: Re: Mohamed's Account System
Post by: nippon on Jun 29, 2018, 03:28 PM
So what do i need to do now?
Title: Re: Mohamed's Account System
Post by: KrOoB_ on Jun 29, 2018, 03:55 PM
plugins folder to copy the names of the dll files and paste it into the server.cfg file

Like this


(https://imgur.com/a/0dbc7Ug)


plugins announce04rel64 hashing04rel64 hashloader04rel64 ini04rel64 irc04rel64 libjavapluginrel64 mysql04rel64
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Jul 19, 2018, 03:33 PM
their is no cmd? deposit and withdraw

@Mohamed
Title: Re: Mohamed's Account System
Post by: KrOoB_ on Jul 20, 2018, 06:54 AM
else if( cmd == "deposit" )
 {
  if (!text) MessagePlayer(  " /deposit <Amount>", player);
  else if (!InPoly(player.Pos.x,player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 )) MessagePlayer(  " you need to be in the bank.", player );
  else if( !IsNum( text ) ) MessagePlayer(  "Use Numeric", player );
  else if ( stats[ player.ID ].Cash < text.tointeger() ) MessagePlayer( "you need money", player );
  else if ( text.tointeger() < 1 ) MessagePlayer( "Invalid amount", player );
  else{
   DecCash( player, text.tointeger() );
   IncBank( player, text.tointeger() );
   MessagePlayer(  ": " + text.tointeger() + "", player );
  }
 }
 
 else if( cmd == "withdraw" )
 {
  if (!text) MessagePlayer( " /withdraw <Amount>", player);
  else if (!InPoly(player.Pos.x,player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 )) MessagePlayer(  " you need to be in the bank.", player );
  else if( !IsNum( text ) ) MessagePlayer(  "Use Numeric", player );
  else if ( 0 > text.tointeger() ) MessagePlayer( "Gecersiz miktar", player );
  else if ( stats[ player.ID ].Bank < text.tointeger() ) MessagePlayer( "Invalid amount", player );
  else{
   DecBank( player, text.tointeger() );
   IncCash( player, text.tointeger() );
   MessagePlayer(  ": " + text.tointeger() + "", player );
  }

Use this bro
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Jul 20, 2018, 08:09 AM
ty
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Jul 20, 2018, 08:15 AM
How to cash which are in my bank

and if player kill any player him rgb will red if cop kill so not ok can u do it?
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Jul 20, 2018, 06:23 PM
[noae]  else if( cmd == "buyprop" )
        {
            local   lp = lastPickupPickedUp[ player.ID ],
                    pos, plp, lpid;
                   
            if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
            else if( lp == null ) return pMSG( "Error - There is no property around.", player );
            else
            {
                if( !FindPickup( lp ) ) return pMSG( "Error - There is no property around.", player );
                else
                {
                    plp = FindPickup( lp );
                    lpid = plp.ID;
                    pos = plp.Pos;
                   
                    if( !PlayerToPoint( player, 1, pos.x, pos.y, pos.z ) ) return pMSG( "Error - There is no property around.", player );
                    else if( prop[ lpid ].Owner != NO_OWNER_MSG ) return pMSG( "Error - This property is not forsale.", player );
                    else if( player.Cash < prop[ lpid ].Price ) return pMSG( "Error - Not enough money.", player );
                    else
                    {
                        pMSG( "Congratz! You bought " + RGB_GREY + prop[ lpid ].Name + RGB_BLUE + " for " + RGB_GREY + prop[ lpid ].Price + RGB_BLUE + " !", player );
                        player.Cash -= prop[ lpid ].Price;
                       
                        UpdateProperty( lpid, prop[ lpid ].Name, prop[ lpid ].Price, player.Name, NO_SHARING_MSG, NO_DESCRIPTION_MSG, pos.x, pos.y, pos.z, plp.World );
                        ReloadProperty( plp, PROP_MODEL_BOUGHT );
                    }
                }
            }
        }
       
        else if( cmd == "sellprop" )
        {
            local   lp = lastPickupPickedUp[ player.ID ],
                    pos, plp, lpid;
                   
            if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
            else if( lp == null ) return pMSG( "Error - There is no property around.", player );
            else
            {
                if( !FindPickup( lp ) ) return pMSG( "Error - There is no property around.", player );
                else
                {
                    plp = FindPickup( lp );
                    lpid = plp.ID;
                    pos = plp.Pos;
                   
                    if( !PlayerToPoint( player, 1, pos.x, pos.y, pos.z ) ) return pMSG( "Error - There is no property around.", player );
                    else if( prop[ lpid ].Owner != player.Name ) return pMSG( "Error - You don't own this property.", player );
                    else
                    {
                        pMSG( "Done! " + RGB_GREY + prop[ lpid ].Name + RGB_BLUE + " was sold for " + RGB_GREY + prop[ lpid ].Price + RGB_BLUE + " !", player );
                        player.Cash += prop[ lpid ].Price;
                        UpdateProperty( lpid, prop[ lpid ].Name, prop[ lpid ].Price, NO_OWNER_MSG, NO_SHARING_MSG, NO_DESCRIPTION_MSG, pos.x, pos.y, pos.z, plp.World );
                        ReloadProperty( plp, PROP_MODEL_FORSALE );
                    }
                }
            }
        }
       
[/noae]

bro how to convert this in your acccount cash system
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Jul 20, 2018, 06:23 PM
can u give me givemoney cmd
Title: Re: Mohamed's Account System
Post by: Milos on Jul 20, 2018, 09:50 PM
I'm tired of seeing "systems" like that.
Those who have a different way of doing this are rare. More like a copy of the old Warchiefs Squirrel.
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Jul 22, 2018, 09:30 AM
@Mohamed bro its hard to make things in your system . and exchange .

this cash system as soon braindonor me .  can u change it ? which all scripts use it? i m tried to exchange .

as soon i will post my cop system :P
Title: Re: Mohamed's Account System
Post by: ! on Jul 23, 2018, 09:48 AM
Quote from: Pop360 on Jul 20, 2018, 09:50 PMI'm tired of seeing "systems" like that.
Those who have a different way of doing this are rare. More like a copy of the old Warchiefs Squirrel.

Hopefully one will be out soon GUI based by me. ;D
(https://i.imgur.com/Gf3sxuu.png)
Title: Re: Mohamed's Account System
Post by: KrOoB_ on Jul 23, 2018, 11:15 AM
Quote from: =RK=MarineForce on Jul 20, 2018, 06:23 PMcan u give me givemoney cmd
try this

else if ( cmd == "nakityolla" )
{
local Pos = player.Pos, checkpoly;
checkpoly = InPoly( Pos.x, Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( stats[ player.ID ].Reg == false ) return MessagePlayer( " [#E0E0E0]kayit olmaniz gerek.", player );
else if ( stats[ player.ID ].Log == false ) return MessagePlayer( " [#E0E0E0]giris yapmaniz gerek", player );
else if ( !player.IsSpawned ) MessagePlayer( " [#E0E0E0]Bunun icin dogman gerek.", player );
else if( checkpoly == false ) MessagePlayer( " [#E0E0E0]Banka kasasina gitmen lazim", player );
else if ( !text )
{
MessagePlayer("Komut: /nakityolla [miktar] [ISIM/ID]", player );
return;
}
else if ( NumTok( text, " " ) < 2 ) MessagePlayer("Komut: /nakityolla [miktar] [ISIM/ID]", player );
else {
local plr = GetPlayer( GetTok( text, " ", 2 ) );
if ( !plr ) MessagePlayer( " Bilinmeyen oyuncu", player );
else if (plr.ID == player.ID) MessagePlayer("Kendine para vermeye calismamalisin",player);
else {
local Poss = plr.Pos, checkpolyy;
checkpolyy = InPoly( Poss.x, Poss.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( checkpolyy == false ) {MessagePlayer("Oyuncu banka kasasinda olmali", player ); MessagePlayer(""+player.Name+" adli oyuncu size para vermek istiyor,parayi alabilmek icin bankada olmaniz gerek!",plr);}
else {
if ( text.tointeger() > player.Cash ) MessagePlayer( " [#E0E0E0]Hatali miktar", player );
else if (!IsNum(GetTok( text, " ", 1 ) ) ) MessagePlayer( " [#E0E0E0]Miktar sayilardan olusmali", player );
else if ( text.tointeger() < 0 ) MessagePlayer( "", player );
else {
DecCash( player, text.tointeger() );
IncCash( plr, text.tointeger() );
MessagePlayer("Verilen para " + text.tointeger() + "$, " + plr.Name + "adli kisi gonderildi",player);
MessagePlayer(""+player.Name+" adli oyuncu size, " + text.tointeger() + "$ gonderdi",plr);
}
}
}
}
}
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Jul 23, 2018, 05:19 PM
can u change lang of this plz
Title: Re: Mohamed's Account System
Post by: Mohamed Boubekri on Jul 23, 2018, 09:13 PM
Quote from: =RK=MarineForce on Jul 23, 2018, 05:19 PMcan u change lang of this plz
You can change lang with yourself by using google.
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Jul 23, 2018, 11:11 PM
oy yeah
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Jul 23, 2018, 11:12 PM
bro mohammed plz change ur cash system

i can't understand

  else if( cmd == "buyprop" )
        {
            local   lp = lastPickupPickedUp[ player.ID ],
                    pos, plp, lpid;
                   
            if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
            else if( lp == null ) return pMSG( "Error - There is no property around.", player );
            else
            {
                if( !FindPickup( lp ) ) return pMSG( "Error - There is no property around.", player );
                else
                {
                    plp = FindPickup( lp );
                    lpid = plp.ID;
                    pos = plp.Pos;
                   
                    if( !PlayerToPoint( player, 1, pos.x, pos.y, pos.z ) ) return pMSG( "Error - There is no property around.", player );
                    else if( prop[ lpid ].Owner != NO_OWNER_MSG ) return pMSG( "Error - This property is not forsale.", player );
                    else if( player.Cash < prop[ lpid ].Price ) return pMSG( "Error - Not enough money.", player );
                    else
                    {
                        pMSG( "Congratz! You bought " + RGB_GREY + prop[ lpid ].Name + RGB_BLUE + " for " + RGB_GREY + prop[ lpid ].Price + RGB_BLUE + " !", player );
                        player.Cash -= prop[ lpid ].Price;
                       
                        UpdateProperty( lpid, prop[ lpid ].Name, prop[ lpid ].Price, player.Name, NO_SHARING_MSG, NO_DESCRIPTION_MSG, pos.x, pos.y, pos.z, plp.World );
                        ReloadProperty( plp, PROP_MODEL_BOUGHT );
                    }
                }
            }
        }
       
        else if( cmd == "sellprop" )
        {
            local   lp = lastPickupPickedUp[ player.ID ],
                    pos, plp, lpid;
                   
            if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
            else if( lp == null ) return pMSG( "Error - There is no property around.", player );
            else
            {
                if( !FindPickup( lp ) ) return pMSG( "Error - There is no property around.", player );
                else
                {
                    plp = FindPickup( lp );
                    lpid = plp.ID;
                    pos = plp.Pos;
                   
                    if( !PlayerToPoint( player, 1, pos.x, pos.y, pos.z ) ) return pMSG( "Error - There is no property around.", player );
                    else if( prop[ lpid ].Owner != player.Name ) return pMSG( "Error - You don't own this property.", player );
                    else
                    {
                        pMSG( "Done! " + RGB_GREY + prop[ lpid ].Name + RGB_BLUE + " was sold for " + RGB_GREY + prop[ lpid ].Price + RGB_BLUE + " !", player );
                        player.Cash += prop[ lpid ].Price;
                        UpdateProperty( lpid, prop[ lpid ].Name, prop[ lpid ].Price, NO_OWNER_MSG, NO_SHARING_MSG, NO_DESCRIPTION_MSG, pos.x, pos.y, pos.z, plp.World );
                        ReloadProperty( plp, PROP_MODEL_FORSALE );
                    }
                }
            }
        }
       

how to give player money
when he rob

stats[player.ID].Cash == 500; no work
....
Title: Re: Mohamed's Account System
Post by: Xhefri on Jul 24, 2018, 05:18 AM
IncCash( player, 500 );
Title: Re: Mohamed's Account System
Post by: KrOoB_ on Jul 25, 2018, 08:56 PM
the best script I see is compatible with all other scripts
 @Mohamed
Title: Re: Mohamed's Account System
Post by: KrOoB_ on Jul 25, 2018, 09:02 PM

does this code belong to you? Or did you get it from someone else ?


[noae]
Quote from: =RK=MarineForce on Jul 23, 2018, 11:12 PMbro mohammed plz change ur cash system

i can't understand

  else if( cmd == "buyprop" )
        {
            local   lp = lastPickupPickedUp[ player.ID ],
                    pos, plp, lpid;
                   
            if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
            else if( lp == null ) return pMSG( "Error - There is no property around.", player );
            else
            {
                if( !FindPickup( lp ) ) return pMSG( "Error - There is no property around.", player );
                else
                {
                    plp = FindPickup( lp );
                    lpid = plp.ID;
                    pos = plp.Pos;
                   
                    if( !PlayerToPoint( player, 1, pos.x, pos.y, pos.z ) ) return pMSG( "Error - There is no property around.", player );
                    else if( prop[ lpid ].Owner != NO_OWNER_MSG ) return pMSG( "Error - This property is not forsale.", player );
                    else if( player.Cash < prop[ lpid ].Price ) return pMSG( "Error - Not enough money.", player );
                    else
                    {
                        pMSG( "Congratz! You bought " + RGB_GREY + prop[ lpid ].Name + RGB_BLUE + " for " + RGB_GREY + prop[ lpid ].Price + RGB_BLUE + " !", player );
                        player.Cash -= prop[ lpid ].Price;
                       
                        UpdateProperty( lpid, prop[ lpid ].Name, prop[ lpid ].Price, player.Name, NO_SHARING_MSG, NO_DESCRIPTION_MSG, pos.x, pos.y, pos.z, plp.World );
                        ReloadProperty( plp, PROP_MODEL_BOUGHT );
                    }
                }
            }
        }
       
        else if( cmd == "sellprop" )
        {
            local   lp = lastPickupPickedUp[ player.ID ],
                    pos, plp, lpid;
                   
            if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
            else if( lp == null ) return pMSG( "Error - There is no property around.", player );
            else
            {
                if( !FindPickup( lp ) ) return pMSG( "Error - There is no property around.", player );
                else
                {
                    plp = FindPickup( lp );
                    lpid = plp.ID;
                    pos = plp.Pos;
                   
                    if( !PlayerToPoint( player, 1, pos.x, pos.y, pos.z ) ) return pMSG( "Error - There is no property around.", player );
                    else if( prop[ lpid ].Owner != player.Name ) return pMSG( "Error - You don't own this property.", player );
                    else
                    {
                        pMSG( "Done! " + RGB_GREY + prop[ lpid ].Name + RGB_BLUE + " was sold for " + RGB_GREY + prop[ lpid ].Price + RGB_BLUE + " !", player );
                        player.Cash += prop[ lpid ].Price;
                        UpdateProperty( lpid, prop[ lpid ].Name, prop[ lpid ].Price, NO_OWNER_MSG, NO_SHARING_MSG, NO_DESCRIPTION_MSG, pos.x, pos.y, pos.z, plp.World );
                        ReloadProperty( plp, PROP_MODEL_FORSALE );
                    }
                }
            }
        }
       

how to give player money
when he rob

stats[player.ID].Cash == 500; no work
....
[/noae]
Title: Re: Mohamed's Account System
Post by: Namir on Jul 26, 2018, 04:45 PM
bro mohamed pls change ur level system

i cant understand

function onScriptUnload()
{
   DisconnectSQL( DataBase );
}

icant add admin levle for my best pakistan friend
Title: Re: Mohamed's Account System
Post by: Mahmoud Tornado on Jul 28, 2018, 08:16 PM
Quote from: =RK=MarineForce on Jul 20, 2018, 06:23 PM[noae][noae]  else if( cmd == "buyprop" )
        {
            local   lp = lastPickupPickedUp[ player.ID ],
                    pos, plp, lpid;
                   
            if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
            else if( lp == null ) return pMSG( "Error - There is no property around.", player );
            else
            {
                if( !FindPickup( lp ) ) return pMSG( "Error - There is no property around.", player );
                else
                {
                    plp = FindPickup( lp );
                    lpid = plp.ID;
                    pos = plp.Pos;
                   
                    if( !PlayerToPoint( player, 1, pos.x, pos.y, pos.z ) ) return pMSG( "Error - There is no property around.", player );
                    else if( prop[ lpid ].Owner != NO_OWNER_MSG ) return pMSG( "Error - This property is not forsale.", player );
                    else if( player.Cash < prop[ lpid ].Price ) return pMSG( "Error - Not enough money.", player );
                    else
                    {
                        pMSG( "Congratz! You bought " + RGB_GREY + prop[ lpid ].Name + RGB_BLUE + " for " + RGB_GREY + prop[ lpid ].Price + RGB_BLUE + " !", player );
                        player.Cash -= prop[ lpid ].Price;
                       
                        UpdateProperty( lpid, prop[ lpid ].Name, prop[ lpid ].Price, player.Name, NO_SHARING_MSG, NO_DESCRIPTION_MSG, pos.x, pos.y, pos.z, plp.World );
                        ReloadProperty( plp, PROP_MODEL_BOUGHT );
                    }
                }
            }
        }
       
        else if( cmd == "sellprop" )
        {
            local   lp = lastPickupPickedUp[ player.ID ],
                    pos, plp, lpid;
                   
            if( player.Vehicle ) return pMSG( "Error - Exit the vehicle first.", player );
            else if( lp == null ) return pMSG( "Error - There is no property around.", player );
            else
            {
                if( !FindPickup( lp ) ) return pMSG( "Error - There is no property around.", player );
                else
                {
                    plp = FindPickup( lp );
                    lpid = plp.ID;
                    pos = plp.Pos;
                   
                    if( !PlayerToPoint( player, 1, pos.x, pos.y, pos.z ) ) return pMSG( "Error - There is no property around.", player );
                    else if( prop[ lpid ].Owner != player.Name ) return pMSG( "Error - You don't own this property.", player );
                    else
                    {
                        pMSG( "Done! " + RGB_GREY + prop[ lpid ].Name + RGB_BLUE + " was sold for " + RGB_GREY + prop[ lpid ].Price + RGB_BLUE + " !", player );
                        player.Cash += prop[ lpid ].Price;
                        UpdateProperty( lpid, prop[ lpid ].Name, prop[ lpid ].Price, NO_OWNER_MSG, NO_SHARING_MSG, NO_DESCRIPTION_MSG, pos.x, pos.y, pos.z, plp.World );
                        ReloadProperty( plp, PROP_MODEL_FORSALE );
                    }
                }
            }
        }
       
[/noae][/noae]

bro how to convert this in your acccount cash system

Just use this.
[noae]local moy = prop[ lpid ].Price;
DecCash( player, moy );  //in buyprop cmd.
IncCash( player, moy ); //in sellprop cmd.
[/noae]
Title: Re: Mohamed's Account System
Post by: Mahmoud Tornado on Jul 28, 2018, 08:19 PM
Quote from: =RK=MarineForce on Jul 20, 2018, 06:23 PMcan u give me givemoney cmd

else if ( cmd == "givemoney" )
{
   if ( !text ) MessagePlayer( "/"+cmd+" <Nick/id> <Money>", player );
   else
   {
      local
         plr = GetPlayer( GetTok( text, " ", 1 ) ),
         moy = GetTok( text, " ", 2);
      if ( !plr ) MessagePlayer( "Unknown Player..", player );
      else if ( !moy ) MessagePlayer("You must give an money.", player);
      else if ( !IsNum( moy ) ) MessagePlayer("Money must be numbers.", player);
      else
      {
         IncCash( plr, moy.tointeger(); )
         Message("[#00de00]Administration Command: [#fbf3f3]Admin "+player.Name+" Has give "+plr.Name+" $'"+moy+"'.");
}
}
}
Title: Re: Mohamed's Account System
Post by: =RK=MarineForce on Jul 29, 2018, 07:53 PM
@Mahmoud Tornado can u save this into cmd i don't know here to add it at line

sell prop

player.Cash += prop[ lpid ].Price;

buy prop


player.Cash -= prop[ lpid ].Price;

how to convert this now
Title: Re: Mohamed's Account System
Post by: Namir on Jul 30, 2018, 09:27 AM
@=RK=MarineForce learn squirtrel and make it urself bro
Title: Re: Mohamed's Account System
Post by: Mahmoud Tornado on Jul 30, 2018, 02:38 PM
Quote from: =RK=MarineForce on Jul 29, 2018, 07:53 PM@Mahmoud Tornado can u save this into cmd i don't know here to add it at line

sell prop

player.Cash += prop[ lpid ].Price;

buy prop


player.Cash -= prop[ lpid ].Price;

how to convert this now
Just add local for prop price
local moy = prop[ lpid ].Price;
Then use this..
DecCash( player, moy ); To delete cash from the player.
and this IncCash( player, moy ); To add cash to the player.
Title: Re: Mohamed's Account System
Post by: Alecu Madalin on May 01, 2019, 06:06 PM
plugins sqlite04rel64 squirrel04rel64 announce04rel64 hashing04rel64 xmlconf04rel64
For 64 bit users