Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Mohamed Boubekri

#21
Snippet Showroom / Command To Test An Anim
Apr 09, 2018, 10:09 AM
Hi, i Made Just a Sample Command To Test Anim, To work of thi Use /animstest <ID> <ID>
Example: /animstest 0 0
if ( cmd == "animstest" || cmd == "testanims")
{
if(!text) MessagePlayer("[ANIM TEST] /"+cmd+" <ID> <ID>", player );
else {
local anim = GetTok( text, " ", 1);
if ( !anim ) MessagePlayer("Make a ID For Anim 1 First..",player);
else if (!IsNum(anim)) MessagePlayer("ID's Must Be In Numbers..",player);
else {
local anim1 = GetTok( text, " ", 1);
if ( !anim1 ) MessagePlayer("Make a ID For Anim 2 First..",player);
else if (!IsNum(anim1)) MessagePlayer("ID's Must Be In Numbers..",player);
else {
player.SetAnim(anim.tointeger(),anim1.tointeger());
}
}
}
}

Don't Forget The Two Functions:-
function GetTok(string, separator, n, ...)
 {
 local m = vargv.len() > 0 ? vargv[0] : n,
 tokenized = split(string, separator),
 text = "";
 if (n > tokenized.len() || n < 1) return null;
 for (; n <= m; n++)
  {
  text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
  }
 return text;
 }
 
 function NumTok(string, separator)
 {
 local tokenized = split(string, separator);
 return tokenized.len();
 }
#22
Script Showroom / Mohamed's Account System
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
#23
Snippet Showroom / [SNIPPET] Warning System
Feb 01, 2018, 12:34 PM
Hello, I Have Made Warning System, So i Love Share it With All! ;D
First Of All Add it In Your ( OnScriptLoad )
warn <- ConnectSQL("scripts/warn.db");
QuerySQL(warn, "create table if not exists warn ( Name VARCHAR(32), Reason TEXT, Admin TEXT, Day VARCHAR(25), Month VARCHAR(25), Year VARCHAR(25), Hour VARCHAR(25), Min VARCHAR(25) )");
Now Add it In Your ( Command )
else if ( cmd == "warn" )
{
if(!text) MessagePlayer("/warn <Player> <Reason>",player);
// else if Your Admin System
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Error: Unknow Player.", player );
{
local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
if ( !reason ) MessagePlayer( "Error: Make Reason.", player );
else if ( plr.Name==player.Name ) MessagePlayer( "Error: You Can't Warn yourself.", player );
else {
local now = date();
QuerySQL( warn, "INSERT INTO warn ( Name, Reason, Admin, Day, Month, Year, Hour, Min ) VALUES ( '" + plr.Name + "', '" + reason + "', '" + player.Name + "', '" + now.day + "', '" + now.month + "', '" + now.year + "', '" + now.hour + "', '" + now.min + "' )" );
Message("Admin "+ player.Name +" Has Warned " +plr.Name+ " Reason: " +reason+ "");
}
}
}
}
else if ( cmd == "unwarn" )
{
local q = QuerySQL( warn,  "SELECT * FROM warn WHERE Name='" + text + "'" );
if(!text) MessagePlayer("/unwarn <Full-Nick>",player);
// else if Your Admin System
else if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "Error: " + text + " is not Warned.", player );
else {
QuerySQL( warn, "DELETE FROM warn WHERE Name='" + text + "'" );
Message("Admin "+ player.Name +" Has Unwarned " +text+ "");
}
}
else if ( cmd == "checkwarn" )
{
if(!text) MessagePlayer("/checkwarn <Full-Nick>",player);
// else if Your Admin System
else {
local q = QuerySQL( warn,  "SELECT * FROM warn WHERE Name='" + text + "'" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "Error: " + text + " is not Warned.", player );
else
{
MessagePlayer( "Player Name Found!", player );
MessagePlayer( "Player : " + text, player );
MessagePlayer( "Warned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "Reason : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "Time Warned: Day: " + GetSQLColumnData( q, 3 ) + " Month: " + GetSQLColumnData( q, 6 ) + " Year: " + GetSQLColumnData( q, 5 ) + " Hour: " + GetSQLColumnData( q, 6 ) + " Min: " + GetSQLColumnData( q, 7 ) + "", player );
}
}
}
NOTE: Command is: /warn, /unwarn, /checkwarn.
NOTE: The System its Sample :D
NOTE: If You See Any Error, Please Report it Here.
NOTE: its Not Copie or Something, its Made By Me, Good Luck ;D
#24
Script Showroom / [Release] Report System
Jan 29, 2018, 09:17 PM
Hello, Many People Say Me, Give Me Link of Any Report Sys, i Don't Find It.
So Now I'm Make It With My Self.

First of All Add it in Your ( OnSriptLoad )
rp <- ConnectSQL("scripts/report.db");
QuerySQL(rp, "create table if not exists report ( Plr TEXT, Name TEXT, Reason TEXT, Day VARCHAR(25), Month VARCHAR(25), Year VARCHAR(25), Hour VARCHAR(25), Min VARCHAR(25) )");
Now Add it In Your Function ( command )
else if ( cmd == "report" )
{
if(!text) MessagePlayer("/report <Player> <Reason>",player);
//Here if You Like Make if player Not Registered
//Here if You Like Make if player Not Logged in
else {
local plr = GetPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Unknow Player.", player );
{
local reason = GetTok( text, " ", 2 NumTok( text, " " ) );
if ( !reason ) MessagePlayer( "Make Reason.", player );
else if ( plr.Name==player.Name ) MessagePlayer( "You Can't Report yourself.", player );
else {
local now = date();
QuerySQL( rp, "INSERT INTO report ( Plr, Name, Reason, Day, Month, Year, Hour, Min ) VALUES ( '" + plr.Name + "', '" + player.Name + "', '" + reason + "', '" + now.day + "/', '" + now.month + "/', '" + now.year + "/', '" + now.hour + ":', '" + now.min + "' )" );
MessagePlayer("Report Successfully Inserted To DataBase",player);
Message("Player "+player.Name+" Has Report " +plr.Name+ " Reason: "+reason+"");
}
}
}
}
NOTE: if You Want check who report & reason & time, Just Open The DataBase of The Report System.
NOTE: Thi its Just Sample System. Good Luck.

#25
Hello i Need that Car But i Don't know how to Converte To VC:MP
Original Link:-http://www.gtainside.com/en/gta3/cars/102255-mercedes-benz-e63-amg-2010/
Thanks Guys very Much :D
#26
Hello, i Have Made one Command /enter if you Are owner And if you Are got the pickup here it is:-
else if( cmd == "enterhouse" )       
{
local lp = lastPickupPickedUp[ player.ID ],
pos, plp, lpid;
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
{
player.Pos = Vector(plr.Pos.x - 2, plr.Pos.y, plr.Pos.z);
player.World = 50;
MessagePlayer("[#00FFFF]Done Your Are Entred To Your House", player );
}
}     
return 0;
}
But For Other House its Not Working.
I Need if player Local That pickup then + 5 For that pickup
I Need Any Idea For House Interior Help
#27
Hello, I Have Port Forward My Server And playing With Me Friends xLreT But Just I Have one Problem
I Have Zombie NPC, My Friend XLreT And Umar4911 And many He's kicked Auto I Dont Know That Problem
But When My Friend Join Zombie WIll Be Kicked, But Not All, Just Some Friends
Here Its Image For That Problem:-

And Please try To Help Me i Want To Disable Function If HP Increase From..To....
#28
Hello, For That Topic i Want Just To Help The Newbie,
Here's Command:-/lockcar <ID> - /unlockcar <ID> - /alarmon <ID> - /alarmoff <ID> - /lighton <ID> - /lightoff <ID>
Command:-Alarm
else if ( cmd == "alarmoff" )
{
if ( !player.IsSpawned ) MessagePlayer("[#ff0000][INFO][#ffffff] You need be spawned to use this command.", player );
else if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /alarmoff <Veh/id>", player );
else if ( !IsNum( text ) ) MessagePlayer( "[#ff0000][INFO][#ffffff] Vehicle/ID Must Be Numbers.", player );
else {
local veh = FindVehicle( text.tointeger() );
if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /alarmon <Veh/id>", player );
else if ( !veh ) MessagePlayer( "[#ff0000][ERROR][#ffffff] Invalid Vehicle/ID.", player );
else {
MessagePlayer( "[#00ffff][INFO][#ffffff] Done You Are Disabled Alarm [ " + GetVehicleNameFromModel( veh.Model ) + " ]." , player )
veh.Alarm = false;
}
}
return 0;
}
else if ( cmd == "alarmon" )
{
if ( !player.IsSpawned ) MessagePlayer("[#ff0000][INFO][#ffffff] You need be spawned to use this command.", player );
else if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /alarmon <Veh/id>", player );
else if ( !IsNum( text ) ) MessagePlayer( "[#ff0000][INFO][#ffffff] Vehicle/ID Must Be Numbers.", player );
else {
local veh = FindVehicle( text.tointeger() );
if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /alarmon <Veh/id>", player );
else if ( !veh ) MessagePlayer( "[#ff0000][ERROR][#ffffff] Invalid Vehicle/ID.", player );
else {
MessagePlayer( "[#00ffff][INFO][#ffffff] Done You Are Enabled Alarm [ " + GetVehicleNameFromModel( veh.Model ) + " ]." , player )
veh.Alarm = true;
}
}
return 0;
}
Command:-Lock-Unlock
else if ( cmd == "unlockcar" )
{
if ( !player.IsSpawned ) MessagePlayer("[#ff0000][INFO][#ffffff] You need be spawned to use this command.", player );
else if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /unlockcar <Veh/id>", player );
else if ( !IsNum( text ) ) MessagePlayer( "[#ff0000][INFO][#ffffff] Vehicle/ID Must Be Numbers.", player );
else {
local veh = FindVehicle( text.tointeger() );
if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /unlockcar <Veh/id>", player );
else if ( !veh ) MessagePlayer( "[#ff0000][ERROR][#ffffff] Invalid Vehicle/ID.", player );
else {
MessagePlayer( "[#00ffff][INFO][#ffffff] Done You Are Unlocked Car [ " + GetVehicleNameFromModel( veh.Model ) + " ]." , player )
veh.Locked = false;
}
}
return 0;
}
else if ( cmd == "lockcar" )
{
if ( !player.IsSpawned ) MessagePlayer("[#ff0000][INFO][#ffffff] You need be spawned to use this command.", player );
else if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /lockcar <Veh/id>", player );
else if ( !IsNum( text ) ) MessagePlayer( "[#ff0000][INFO][#ffffff] Vehicle/ID Must Be Numbers.", player );
else {
local veh = FindVehicle( text.tointeger() );
if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /lockcar <Veh/id>", player );
else if ( !veh ) MessagePlayer( "[#ff0000][ERROR][#ffffff] Invalid Vehicle/ID.", player );
else {
MessagePlayer( "[#00ffff][INFO][#ffffff] Done You Are Locked Car [ " + GetVehicleNameFromModel( veh.Model ) + " ]." , player )
veh.Locked = true;
}
}
return 0;
}
Command:-Lights
else if ( cmd == "lighton" )
{
if ( !player.IsSpawned ) MessagePlayer("[#ff0000][INFO][#ffffff] You need be spawned to use this command.", player );
else if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /lighton <Veh/id>", player );
else if ( !IsNum( text ) ) MessagePlayer( "[#ff0000][INFO][#ffffff] Vehicle/ID Must Be Numbers.", player );
else {
local veh = FindVehicle( text.tointeger() );
if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /lighton <Veh/id>", player );
else if ( !veh ) MessagePlayer( "[#ff0000][ERROR][#ffffff] Invalid Vehicle/ID.", player );
else {
MessagePlayer( "[#00ffff][INFO][#ffffff] Done You Are Enabled Lights [ " + GetVehicleNameFromModel( veh.Model ) + " ]." , player )
veh.Lights = true;
}
}
return 0;
}
else if ( cmd == "lightoff" )
{
if ( !player.IsSpawned ) MessagePlayer("[#ff0000][INFO][#ffffff] You need be spawned to use this command.", player );
else if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /lightoff <Veh/id>", player );
else if ( !IsNum( text ) ) MessagePlayer( "[#ff0000][INFO][#ffffff] Vehicle/ID Must Be Numbers.", player );
else {
local veh = FindVehicle( text.tointeger() );
if ( !text ) MessagePlayer( "[#00ffff][INFO][#ffffff] /lightoff <Veh/id>", player );
else if ( !veh ) MessagePlayer( "[#ff0000][ERROR][#ffffff] Invalid Vehicle/ID.", player );
else {
MessagePlayer( "[#00ffff][INFO][#ffffff] Done You Are Disabled Lights [ " + GetVehicleNameFromModel( veh.Model ) + " ]." , player )
veh.Lights = false;
}
}
return 0;
}
Hope iTs Help :P


#29
Hello, I Have Got command /adminchat From @umar4911
I Do /adminchat iTs Work But i Dont Know What is Problem.
I Have Setlevel of Umar To 4 And i Do /adminchat <HAHAHA> But @umar4911 Say me i Dont Receirve Anything.
Here iTs Command:-
else if ( ( cmd == "adminchat" )
{
if(pstats[ player.ID ].Level < 3 ) MessagePlayer("[#FFDD33]Information:[#FFFFFF] Unauthorized Access", player);
else if(!text) MessagePlayer("[#FF0000]Command Error:[#FFFFFF] Use /" + cmd + " [Message]", player);
else {
local plr;
for( local i = 0; i <= GetMaxPlayers(); i++ )
{
plr = FindPlayer( i );
if ( ( plr ) && ( pstats[ plr.ID ].Level >= 3 ) )
{
MessagePlayer("[#00ff00][Admin Chat] : [#00ffff]" + playerName + " : [#FFFFFF]" + text + ".", plr);
}
}
ITs Wok But i Dont Know What Is Problem :( Help Me...
#30
Hello, My DataBase Is fucked Up With Name 0x00.... Some Car Its Modern And its Work Fine.

When Me Do /setpos Pos not Changed :( But For Car Work Pos Chenged!!!!

When Me Do /deletcar Car Removed But I'll Back But Other Cars Work Its Deleted.

When Me Sit For Car Say Me owner 0x0000 owner : 0x0000.......But Some Car Its Work Fine.

And I'm using The Gotoloc/Saveloc System For Same DataBase.

Now I'm Want To gave Me help You guys.

1 : I'm Have 176 Cars Hm that Its My Problem ?

2 : How Much Vehicles Can Do For DataBase ?

3 : I Can Fix My DataBase ?

4 : System Saveloc Can Fked My DataBase ?
#31
Hello Guys How Are you All! :D I was finding How To Change The Cost Car i Have Made one Functions But Its Not Working

Note : I'm using Veh System @KrlozZ...

My Function ( I Added it For OnScriptLoad ).

QuerySQL( Vehicles, "UPDATE Price SET = '2500000' WHERE Model = '191' " );
I Added it But I'm Join The Game Not Say Me Anything :/
I Want To Set All Car infernus With 2500000$

My Table :
QuerySQL(Vehicles, "CREATE TABLE IF NOT EXISTS Creation ( id NUMERIC, model NUMERIC, x NUMERIC, y NUMERIC, z NUMERIC, col1 NUMERIC, col2 NUMERIC, world NUMERIC, angle NUMERIC)" );
QuerySQL(Vehicles, "CREATE TABLE IF NOT EXISTS Sale ( ID NUMERIC, Cost NUMERIC, Owner TEXT, Shared TEXT, Shared2 TEXT )" );
#32
Snippet Showroom / [SNIPPET] BanInfo Command.
Nov 19, 2017, 07:11 PM
Hello The Command Already Posted For Liberty City Forum
But its For VCMP 0.3
I'm Transfered It To 0.4 Only For the Newbie.

Command : ( For The Ban System @Diego^ )

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( db,  "SELECT * FROM SubBans WHERE Name='" + text + "'" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}

Command : ( For the Ban System @zeus )

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "[#00BBFF][INFO][#ffffff] /baninfo <Full-Nick>", player );
// If Player Not Logged In Message Here
// Level To Acces As That Command
else {
local q = QuerySQL( db, "SELECT * FROM Bans WHERE Name='" + text + "' COLLATE NOCASE" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "[#ff0000][Error] - " + text + " is not Banned.", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
}

                                                                                Hope Its Help :D




#33
Hello Guys, i Have Command /baninfo Its Work Fine But //.

if Me Do /baninfo Say me Info for my self

i want to see info ban for other player. [ plr.name ) xd

else if ( cmd == "baninfo" )
{
local q = QuerySQL( db, "SELECT * FROM Bans WHERE Name='" + text + "' COLLATE NOCASE" );
if (!q) MessagePlayer( "[Error] - The player is not banned", player );
else
{
MessagePlayer( "[#00ffff][INFO][#ffffff] Player Name Found!", player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Player : " + text, player );
MessagePlayer( "[#00ffff][INFO][#ffffff] IP : " + GetSQLColumnData( q, 1 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Banned by : " + GetSQLColumnData( q, 2 ), player );
MessagePlayer( "[#00ffff][INFO][#ffffff] Reason : " + GetSQLColumnData( q, 3 ), player );
}
}
[/]

                                                                              Helppppppppppp :'(


#34
Hello Guys I need Command /goto With Time 3 Second

Nogoto on/off and /heal with time with functions

HELP
#35
Hello Guys. I'm Very Happy Bcz Yaster-Day im Port Forward all me friend Join my Server showeing.
My Server shuting down, And I'm Port Forward Agin im check port its work but when me do my ip not say me" waiting for data" but
say me Unknow Server,,,

1 : i need Announcer Plugin ?

2 : I'm Need To Every day Port Forward ?


                                                                    Please Ask :'(((
#36
Hello Allll. Good Night Everyone,
Today I'm Join To Tell You My problem.
I'm Want Turn Light ON or OFF Just For Boutton [ L ]
I have commands with /lighton /lightoff No Want That//
Want ON or OFF With Boutton / Keys L
#37
Please Can Asked For All me Qaistion.

1 : The Fuzzi Accoun System Save Stats Player or no? but fuzzi accoun system saved level from me.

2 : Im Downloaded all command alll work now iknow about Scripting, Just If Me Setmoney that Not Saveed??? How to Work it??

3 : Fuzzi Account System, Is Niice?? No Problem??

Please Asked Me ( And Describe For Me Please ).
#38
im downloading money system its work
but if me leave game cash not saveed but level and car and ban all saved allll work.
Need : Function Save Cash

Command : else if ( cmd =="setmon" )
{
if (!text) MessagePlayer("Syntax - /setmon <nick/id> <amount>",player);
else
{
local plr = GetPlayer( GetTok(text," ",1)), mon = GetTok(text," ",2);
if (!plr) MessagePlayer("Invalid Player",player);
else if (!mon) MessagePlayer("Money not specified",player);
else if (!IsNum(mon)) MessagePlayer("Money must be in number",player);
else
{
pstats[ plr.ID ].Cash += mon.tointeger();
player.Cash = pstats[plr.ID].Cash;
Message("Admin "+player.Name+" Has given "+mon+" $ to "+plr.Name+"");
}
}
}

Noteee :    Using Fuzzi Account System
#39
Script and Content Requests / Request Module?
Nov 03, 2017, 07:53 PM
Hiiii Guys For thi Day im Hapyyyyyyyyyyyyy bcz im download level and setlevel and admin and acmds all workeed.
Now i need Finish my Happy :X im download baning system by diego workss Now Need Command Tempban,
i downloading Tempban rokkie its work but, Can Any one give me Module ( sq_lite" ); And ( "Data.sqlite" )
Thanks.



Regards, [AFt]We3da^
#40
Hello Guys.
i m need Commands level and setlevel i am download one but
i am Using [ Fuzzi Account SYstem ]Any one Give me Command level and setlevel For Account Fuzzi.
And Thanks.