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.

Messages - Mahmoud Tornado
1
Quote from Doom_Kill3R on March 17th, 05:30 AM
You can't pass player instances in timers, it crashes the server, pass player ID and and find the player on callback function
That's was one of my problems when i made Anti-Spawnkill.
2
Script and Content Requests / [READ-ME] Re: Before requesting content.
« on February 28th, 12:08 PM »
Quote from Athanatos on February 26th, 05:52 PM
short and simple.
And, giving tutorials...
3
Quote from Dominio on February 8th, 01:00 AM
By the way, check the web, but I find that many are only SA, is not practically VC.
The only difference between SA and VC is in the bones, So you must know VC bones and SA bones, in the site it's SA's skin tutorial, open any VC skin with your 3DSMax and see the different.
4
Snippet Showroom / Re: Cop System
« on January 25th, 09:09 AM »
Quote from Athanatos on January 21st, 03:43 PM
No shit sherlock, he just made a few cmds, and that's it, he's the best scripter over there.
Hey Athanatos, he was a newbie, we was telling him to make the scripts with himself, and he was asking us a lot.
So, it's nice to see him doing script with himself, Mohamed proud of him.
Quote from Mohamed on July 23rd, 2018, 10:15 PM
GooD JoB, You are now best.
There's a different in Best and The Best, you surely know it, so you used it here.
Quote from Athanatos on January 21st, 03:43 PM
he's the best scripter over there.
Finally, Your zombie server is cool i saw it.
5
Snippet Showroom / Last Position.
« on December 7th, 2018, 08:54 PM »
Just sharing to help, no thing can be explained.

Code: [Select]
function onScriptLoad()
{
Stats <- array(GetMaxPlayers(), null);
Lastpos <- ConnectSQL( "MT-LastVectors.db" );
QuerySQL( Lastpos, "CREATE TABLE IF NOT EXISTS Locations ( Name VARCHAR(32), LastPosX VARCHAR(25), LastPosY VARCHAR(25), LastPosZ VARCHAR(25), LastPos TEXT )" );
}

function onPlayerSpawn(player)
{
if ( player.World == 1 )
{
local q = QuerySQL(Lastpos, "SELECT * FROM Locations WHERE Name = '" + player.Name + "'");
if( q && GetSQLColumnData(q, 4) == "on" )
{
local Y = GetSQLColumnData(q, 2).tointeger(),
X = GetSQLColumnData(q, 1).tointeger(),
Z = GetSQLColumnData(q, 3).tointeger();
player.Pos = Vector( X, Y, Z);
MessagePlayer("You has been landed in your last location.", player);
}
}
}

function onPlayerCommand( player, cmd, text )
{
if(cmd == "lastpos")
{
if(!text) MessagePlayer("[#ff0000]/" + cmd + " <on/off>", player);
local q = QuerySQL(Lastpos, "SELECT * FROM Locations WHERE Name = '" + player.Name + "'");
if(!q) QuerySQL(Lastpos, "INSERT INTO Locations ( Name, LastPosX, LastPosY, LastPosZ, Lastpos ) VALUES ( '" + player.Name + "', '0' , '0' , '0','null' ) ");
else
{
if(text == "on")
{
QuerySQL(Lastpos, "UPDATE Locations SET Lastpos = 'on' WHERE Name = '" + player.Name + "'");

Announce( "~t~Lastpos Enabled", player , 0 );
}
if(text == "off")
{
QuerySQL(Lastpos, "UPDATE Accounts SET Lastpos = 'off' WHERE Name = '" + player.Name + "'");
Announce( "~y~Lastpos Disabled", player , 0 );
}
}
}
}

function onPlayerPart( player, reason )
{
local q = QuerySQL(Lastpos, "SELECT * FROM Locations WHERE Name = '" + player.Name + "'");
if(!q) return 0;
else{
QuerySQL(Lastpos, "UPDATE Locations SET LastPosX = '" + player.Pos.x + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosY = '" + player.Pos.y + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosZ = '" + player.Pos.z + "' WHERE Name = '" + player.Name + "'");
}
}

function onPlayerKill( killer, player, reason, bodypart )
{
local q = QuerySQL(Lastpos, "SELECT * FROM Locations WHERE Name = '" + player.Name + "'");
if(!q) return 0;
else{
QuerySQL(Lastpos, "UPDATE Locations SET LastPosX = '" + player.Pos.x + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosY = '" + player.Pos.y + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosZ = '" + player.Pos.z + "' WHERE Name = '" + player.Name + "'");
}
}

function onPlayerDeath( player, reason )
{
local q = QuerySQL(Lastpos, "SELECT * FROM Locations WHERE Name = '" + player.Name + "'");
if(!q) return 0;
else{
QuerySQL(Lastpos, "UPDATE Locations SET LastPosX = '" + player.Pos.x + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosY = '" + player.Pos.y + "' WHERE Name = '" + player.Name + "'");
QuerySQL(Lastpos, "UPDATE Locations SET LastPosZ = '" + player.Pos.z + "' WHERE Name = '" + player.Name + "'");
}
}
6
Script and Content Requests / Re: Command - Addobject and Addpickups
« on November 8th, 2018, 07:00 PM »
Addobject, you need an mapping system like doom's one, or make an fully one by yourself. Clicky.
Addpickup, Is to easier than it, add something like this in your server, and config them from nPickupPickedUp( player, pickup ). U can change this simple system, Clicky.
7
Snippet Showroom / Re: Basic Ban System
« on October 21st, 2018, 11:59 PM »
We will back to that again? WTF!
Quote from Mahmoud Tornado on May 11th, 2018, 12:24 AM
I don't have warchief Script.
8
Servers / Re: New Cars & Bikes Mode
« on October 19th, 2018, 11:24 PM »
Lol? ???
9
Community Plugins / Re: SQLite module for Squirrel.
« on October 11th, 2018, 05:44 PM »
Quote from =RK=MarineForce on October 6th, 2018, 08:25 PM
Hey, Bro how to use GetSQLColumnCount <- SQLite_ColumnCount;
GetSQLColumnData <- SQLite_ColumnData;

i don't understand :P , Xd
So you understood this?
Code: [Select]
ConnectSQL <- SQLite_Open;
DisconnectSQL <- SQLite_Close;
QuerySQL <- SQLite_Query;
GetSQLNextRow <- SQLite_NextRow;
FreeSQLQuery <- SQLite_Release;
escapeSQLString <- SQLite_Escape;
10
Support / Re: login system bugged
« on October 4th, 2018, 10:52 AM »
Might be, in ErrorMessage --> PlayerMessage. "If you didn't change it!"
Or you didn't add Login function!
Or status be like Status, or stats, or Stats.

Off-Topic: In anybug, add an photo to the error from the server log, and that line which have had the problem.
11
Script and Content Requests / Re: Hello Guyz can some one teach me ?
« on October 4th, 2018, 10:38 AM »
Make SaveStats function!.

Code: [Select]
QuerySQL( database, "UPDATE Players SET Cash='"+Stats[ player.ID ].Cash+"',Bank='"+Stats[ player.ID ].Bank+"' WHERE Name LIKE '" + player.Name + "'" );
12
Script and Content Requests / Re: Hello Guyz can some one teach me ?
« on September 24th, 2018, 07:08 PM »
Quote from KuRuMi^ on September 22nd, 2018, 07:57 AM
Quote from =RK=MarineForce on September 21st, 2018, 02:53 PM
Code: [Select]
class PlayerStats
{
login = false;
register = false;
}

function onScriptLoad()
{
db <- ConnectSQL( "DataBase.db" );
QuerySQL( db, "CREATE TABLE IF NOT EXISTS Stats ( Name VARCHAR(32), IP VARCHAR(25), Admin TEXT, Reason TEXT )" );

database<- ConnectSQL( "database.db" );
QuerySQL( database, "CREATE TABLE IF NOT EXISTS Stats ( player VARCHAR(255), password VARCHAR(255), uid VARCHAR(255) " );
Stats <- array(GetMaxPlayers(), null);
print("Register,Login System Has Been Loaded by MarineForce");
}

function onScriptUnload()
{
DisconnectSQL( db );
DisconnectSQL( database );
}

function onPlayerJoin( player )
{
Stats[player.ID] = PlayerStats();
Message(" " + player.Name + " Has Joined The server  : " + player.IP + " ");

}

function onPlayerCommand( player, cmd, text )
{
if ( cmd == "register" )
{
  if ( ( Stats[ player.ID ].register ) || ( Stats[ player.ID ].login ) ) PrivMessage( player, "Error: You are already registered." );
  else if ( !text ) PrivMessage( player, format( "Error: Use /%s <password>", cmd ) );
  else
  {
   QuerySQL( database, "INSERT INTO Stats ( player, password, uid) VALUES ( '" + player.Name.tolower() + "', '" + SHA256( text ) + "', '" + player.UniqueID + "', '0', '0', '0', '1', '0', '1', 'on' )" );
   Stats[player.ID].register = true;
   Stats[player.ID].login = true;
   PrivMessage( player, format( "You have been successfully registered! Nickname:[ %s ] Password:[ %s ]", player.Name, text ) );
   MessageAllExcept( format( "[#00FF00]>> %s has been successfully registered.", player.Name ), player );
  }
}

else if ( cmd == "login" )
{
  if ( Stats[ player.ID ].login ) PrivMessage( player, "Error: You are already logged-in." );
  else if ( !text ) PrivMessage( player, format( "Error: Use /%s <password>", cmd ) );
  else if ( SHA256( text ) != GetSQLColumnData( QuerySQL( database, "SELECT password FROM Stats WHERE player = '" + player.Name.tolower() + "'" ), 0 ) ) PrivMessage( player, "INVALID PASSWORD." );
  else
  {
   local query = QuerySQL( database, "SELECT * FROM Stats WHERE player = '" + player.Name.tolower() + "'" );
   if ( query )
   {
   Stats[player.ID].register = true;
   Stats[player.ID].login = true;
   Message(" Welcome Back To Server " + player.Name + " ");
   }
   else PrivMessage( player, "wtf" );
  }
}
}
its not save the data when i quit. Commands Made by =TRC=Kelvin. i can but i need to know about steps.

///if i learn this thing i hope i will make my own Account System :P

///Some Things From Kelvin aCCOUNT system which i don't understand its only in cmd

Can u tell me, how to use it and what is . it

Code: [Select]
//what is GetSQLColumnData ??? and tolower

 ' + player.Name.tolower()+"' ");  what it Tolower?

I know QuerySQL( database, "SELECT password FROM Stats WHERE player  = ' " +
//else if ( SHA256( text ) != GetSQLColumnData( QuerySQL( database, "SELECT password FROM account WHERE player = '" + player.Name.tolower() + "'" ), 0 ) ) PrivMessage( player, "INVALID PASSWORD." );
// QuerySQL( database, "INSERT INTO Stats ( player, password, uid)
 //  VALUES ( '" + player.Name.tolower() + "', '" + SHA256( text ) + "', '" + player.UniqueID + "', '0', '0', '0', '1', '0', '1', 'on' )" );
Haven't you written a code where it'll update the player's statistics into the database on the onPlayerPart event?
I can remember that, @KuRuMi^ . ^-^
13
Script and Content Requests / Re: .db
« on September 22nd, 2018, 01:53 AM »
@Humzasajjad, If you use the first on in your account system use this one.
Code: [Select]
else if ( cmd == "setlevel" )
{
   if ( !text ) MessagePlayer( "/"+cmd+" <Nick/id> <Level>", player );
   else
   {
      local
         plr = GetPlayer( GetTok( text, " ", 1 ) ),
         lvl = GetTok( text, " ", 2);
      if ( !plr ) MessagePlayer( "Unknown Player..", player );
     else if ( !lvl ) MessagePlayer("You must put a level.", player);
      else if ( !IsNum( lvl ) ) MessagePlayer("Level must be in numbers.", player);
      else
      {
         Stats[ plr.ID ].Level = lvl.tointeger();
         QuerySQL( db,"UPDATE Database SET Level='"+lvl+"' WHERE lower(Name) LIKE '"+plr.Name+"'");
         Message("Administration Command: Admin "+player.Name+" Has Set level of "+plr.Name+" to: "+lvl+".");
      }
   }
}

If you using the second one use this,
Code: [Select]
if ( cmd == "setlevel" )
{
if ( !text ) MessagePlayer( "/"+cmd+" <Nick/id> <Level>", player );
   else
   {
      local
         plr = GetPlayer( GetTok( text, " ", 1 ) ),
         lvl = GetTok( text, " ", 2),
      if ( !plr ) MessagePlayer( "Unknown Player..", player );
     else if ( !lvl ) MessagePlayer("You must put a level.", player);
      else if ( !IsNum( lvl ) ) MessagePlayer("Level must be in numbers.", player);
      else
      {
   local q = QuerySQL(Admindb, "SELECT * FROM Admins WHERE Name = '" + escapeSQLString(plr.Name) + "'");
  if (!q)   QuerySQL( DataBase, "INSERT INTO Accounts ( Name, LowerName, Level ) VALUES ( '" + escapeSQLString(plr.Name) + "','" + escapeSQLString(plr.Name) + "','" + 0 + "')" );
  else
 {
         Stats[ plr.ID ].Level = lvl.tointeger();
  QuerySQL( Admindb, "UPDATE Admins SET Level='"+lvl+"' WHERE Name LIKE '" + plr.Name + "'" );
         Message("Administration Command: Admin "+player.Name+" Has Set "+plr.Name+" As an admin level: "+lvl+".");
      }
    }
   }
}

It's not doing thing, as you are using the two systems together, and you can't make two level stats for the player.
Quote from Humzasajjad on September 20th, 2018, 12:49 PM
QuerySQL(db, "create table if not exists Database ( Name TEXT, LowerName TEXT, Password VARCHAR(255), Level NUMERIC DEFAULT 1, IP VARCHAR(255) ");
This is the first system, this is a addition to accounts system.

But the command which you used is for the admins db.
Quote from Humzasajjad on September 20th, 2018, 12:49 PM
if ( cmd == "setlevel" )
{
if ( !text ) MessagePlayer( "/"+cmd+" <Nick/id> <Level>", player );
   else
   {
      local
         plr = GetPlayer( GetTok( text, " ", 1 ) ),
         lvl = GetTok( text, " ", 2),
      if ( !plr ) MessagePlayer( "Unknown Player..", player );
     else if ( !lvl ) MessagePlayer("You must put a level.", player);
      else if ( !IsNum( lvl ) ) MessagePlayer("Level must be in numbers.", player);
      else
      {
   local q = QuerySQL(Admindb, "SELECT * FROM Admins WHERE Name = '" + escapeSQLString(plr.Name) + "'");
  if (!q)   QuerySQL( DataBase, "INSERT INTO Accounts ( Name, LowerName, Level ) VALUES ( '" + escapeSQLString(plr.Name) + "','" + escapeSQLString(plr.Name) + "','" + 0 + "')" );
  else
 {
         Stats[ plr.ID ].Level = lvl.tointeger();
  QuerySQL( Admindb, "UPDATE Admins SET Level='"+lvl+"' WHERE Name LIKE '" + plr.Name + "'" );
         Message("Administration Command: Admin "+player.Name+" Has Set "+plr.Name+" As an admin level: "+lvl+".");
      }
    }
   }
}
So it must get error.
14
Script and Content Requests / Re: Hello Guyz can some one teach me ?
« on September 22nd, 2018, 01:48 AM »
GetSQLColumnData
Tolower
"The C library function int tolower(int c) converts a given letter to lowercase."
15
Snippet Showroom / [Snippet] GetVehicleNameFromModel, GetVehicleType [For Custom, Originals Vehs]
« on September 20th, 2018, 03:00 PM »
GetVehicleNameFromModel()*
Code: [Select]
MessagePlayer("Entered In: "+GetVehicleNameFromModel( player.Vehicle.Model )+".")

Code: [Select]
function GetVehicleNameFromModel(model)
{
switch(model)
{
case 130: return "Landstalker";
case 131: return "Idaho";
case 132: return "Stinger";
case 133: return "Linerunner";
case 134: return "Perennial";
case 135: return "Sentinel";
case 136: return "Rio";
case 137: return "Firetruck";
case 138: return "Trashmaster";
case 139: return "Stretch";
case 140: return "Manana";
case 141: return "Infernus";
case 142: return "Voodoo";
case 143: return "Pony";
case 144: return "Mule";
case 145: return "Cheetah #1";
case 146: return "Ambulance";
case 147: return "FBI Washington";
case 148: return "Moonbeam";
case 149: return "Esperanto";
case 150: return "Taxi";
case 151: return "Washington";
case 152: return "Bobcat";
case 153: return "Mr Whoopee";
case 154: return "BF Injection";
case 155: return "Hunter";
case 156: return "Police";
case 157: return "Enforcer";
case 158: return "Securicar";
case 159: return "Banshee";
case 160: return "Predator";
case 161: return "Bus";
case 162: return "Rhino";
case 163: return "Barracks OL";
case 164: return "Cuban Hermes";

case 166: return "Angel";
case 167: return "Coach";
case 168: return "Cabbie";
case 169: return "Stallion";
case 170: return "Rumpo";
case 171: return "RC Bandit";
case 172: return "Romero's Hearse";
case 173: return "Packer";
case 174: return "Sentinel XS";
case 175: return "Admiral";
case 176: return "Squalo";
case 177: return "Sea Sparrow";
case 178: return "Pizza boy";
case 179: return "Gang Burrito";

case 182: return "Speeder";
case 183: return "Reefer";
case 184: return "Tropic";
case 185: return "Flatbed";
case 186: return "Yankee";
case 187: return "Caddy";
case 188: return "Zebra Cab";
case 189: return "Top Fun";
case 190: return "Skimmer";
case 191: return "PCJ 600";
case 192: return "Faggio";
case 193: return "Freeway";
case 194: return "RC Baron";
case 195: return "RC Raider";
case 196: return "Glendale";
case 197: return "Oceanic";
case 198: return "Sanchez";
case 199: return "Sparrow";
case 200: return "Patriot";
case 201: return "Love Fist";
case 202: return "Coast Guard";
case 203: return "Dinghy";
case 204: return "Hermes";
case 205: return "Sabre";
case 206: return "Sabre Turbo";
case 207: return "Phoenix";
case 208: return "Walton";
case 209: return "Regina";
case 210: return "Comet";
case 211: return "Deluxo";
case 212: return "Burrito";
case 213: return "Spand Express";
case 214: return "Marquis";
case 215: return "Baggage Handler";
case 216: return "Kaufman Cab";
case 217: return "Maverick";
case 218: return "VCN Maverick";
case 219: return "Rancher";
case 220: return "FBI Rancher";
case 221: return "Virgo";
case 222: return "Greenwood";
case 223: return "Cuban Jetmax";
case 224: return "Hotring Racer #1";
case 225: return "Sandking";
case 226: return "Blista Compact";
case 227: return "Police Maverick";
case 228: return "Boxville";
case 229: return "Benson";
case 230: return "Mesa Grande";
case 231: return "RC Goblin";
case 232: return "Hotring Racer #2";
case 233: return "Hotring Racer #3";
case 234: return "Bloodring Banger #1";
case 235: return "Bloodring Banger #2";
case 236: return "Cheetah #2";

case 6400: return " "; //For the first custom car.
default: return "Name not specified";
}
}


GetVehicleType()*
Code: [Select]
MessagePlayer("Entered In: "+GetVehicleType( player.Vehicle.Model )+".")

Code: [Select]
function GetVehicleType( model )
{
        switch ( model ) {
                case 166:
                case 178:
                case 191:
                case 192:
                case 193:
                case 198:
                        return "Bike";
                case 155:
                case 165:
                case 217:
                case 218:
                case 227:
                        return "Heli";
                case 180:
                case 181:
                        return "Plane";
                case 136:
                case 160:
                case 176:
                case 182:
                case 183:
                case 184:
                case 190:
                case 202:
                case 203:
                case 214:
                case 223:
                        return "Boat";
                case 171:
                case 194:
                case 195:
                case 231:
                        return "RC";
                case 6400:
                        return "Special Model";
                default:
                        return "Car";
        }
}