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.

Topics - Mahmoud Tornado
1
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 + "'");
}
}
2
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";
        }
}
3
Support / Map Size.
« on September 3rd, 2018, 02:38 AM »
Hi all, i have a question here,
Can i add a big map in the server like san andreas.
As we all know that when we go into water we will get an invisible wall.
Can i delete it to add more big map?
Thanks.
4
Support / Skins Ifp.
« on August 14th, 2018, 09:34 PM »
Hi All, i was adding an custom skin but i wanna add an ifp file <peds.ifp>.
It this possible or not? and if it, how?
5
Snippet Showroom / GTA Vice-City: Cheats.
« on July 11th, 2018, 05:46 PM »
Was walking in the forum and saw this http://forum.vc-mp.org/?topic=3883.0 so i made some cheats for the game if someone need it.
Cheats:
PANZER == Spawn a tank
TRAVELINSTYLE == Spawn a Bloodring Banger
GETTHEREQUICKLY == Spawn a fast Bloodring Banger
THELASTRIDE    == Spawn Romero's hearse
ROCKANDROLLCAR == Spawn a v-rock car
GETTHEREFAST == Spawn a Sabre Turbo
RUBBISHCAR == Spawn a garbage truck
BIGBANG == Create Explosions
CHEATSHAVEBEENCRACKED == Play as Ricardo Diaz
LOOKLIKELANCE == Play as Lance Vance
MYSONISALAWYER == Play as Ken Rosenberg
LOOKLIKEHILARY == Play as Hilary King
ROCKANDROLLMAN == Play as Love Fist character (Jezz Torent)
WELOVEOURDICK == Play as Love Fist character (Dick)
ONEARMEDBANDIT == Play as Phil Cassidy
IDONTHAVETHEMONEYSONNY == Play as Sonny Forelli
FOXYLITTLETHING == Play as Mercedes
ASPIRINE == Hp = 100
CANTTAKEITANYMORE == Character commits suicide
SEAWAYS == Drive in water allowed


Normally add this onPlayerChat( player, text )
Code: [Select]
text = text.tolower ( );
if ( text == "panzer")
    {
    CreateVehicle( 162, player.World, player.Pos.x +2, player.Pos.y +2, player.Pos.z +2, 0, 0, 0 );
    }
if ( text == "travelinstyle")
    {
    CreateVehicle( 234, player.World, player.Pos, 0, 3, 1 );
    }
if ( text == "gettherequickly")
    {
    CreateVehicle( 235, player.World, player.Pos, 0, 2, 0 );
    }
if ( text == "thelastride")
    {
    CreateVehicle( 172, player.World, player.Pos, 0, 0, 0 );
    }
if ( text == "rockandrollcar")
    {
    CreateVehicle( 139, player.World, player.Pos, 0, 0, 0 );
    }
if ( text == "gettherefust")
    {
    CreateVehicle( 206, player.World, player.Pos, 0, 0, 0 );
    }
if ( text == "rubbishcar")
    {
    CreateVehicle( 138, player.World, player.Pos, 0, 0, 0 );
    }
if ( text == "bigbang")
    {
    for(local i =0 ; i < 1000; i++) if(FindVehicle(i) != null) FindVehicle(i).Kill();
    }
if ( text == "cheatshavebeencracked")
    {
    player.Skin = 105;
    }
if ( text == "looklikelance")
    {
    player.Skin = 114;
    }
if ( text == "mysonisalawyer")
    {
    player.Skin = 107;
    }
if ( text == "looklikehilary")
    {
    player.Skin = 109;
    }
if ( text == "rockandrollman")
    {
    player.Skin = 110;
    }
if ( text == "weloveourdick")
    {
    player.Skin = 116;
    }
if ( text == "onearmedbandit")
    {
    player.Skin = 127;
    }
if ( text == "idonthavemoneysonny")
    {
    player.Skin = 113;
    }
if ( text == "foxylittlething")
    {
    player.Skin = 115;
    }
if ( text == "aspirine")
    {
    player.Health = 100;
    }
if ( text == "preciousprotection")
    {
    player.Armour = 100;
    }
if ( text == "canttakeitanymore")
    {
    player.Health = 0;
    }
if ( text == "seaways")
    {
    SetDriveOnWater( true );
    }
I hope to be at least helped one.
Mahmoud. <3
6
Snippet Showroom / Spawnloc - 2 Ways 2 Commands.
« on July 10th, 2018, 03:19 AM »
Hello, dear VC-MP community.
Still friends requests for making system and now a lot of newbie scripters asked me for spawnloc but they don't wanna the same system,
So i made all of them here.

2 Ways
First way is with PlayerClass mean that when you leave the server it will delete the vectors.
Second way is with database it will save the vectors for every time when player getting in the server.

2 Commands
First cmd is with /setspawnloc that mean you must use it first to save your spawnloc location.
Seconed cmd is only /spawnloc <on, off> the vectors is saving when you type on.


First way - Stats

PlayerClass
Code: [Select]
Spawnloc = false; // Using to make the spawnloc settings.
VectorX = 0; // spawnloc Vector X.
VectorY = 0; // spawnloc Vector Y.
VectorZ = 0; // spawnloc Vector Z.

onScriptLoad()
Code: [Select]
Stats <- array(GetMaxPlayers(), null); // Loading stats..

onPlayerJoin( player )
Code: [Select]
Stats[ player.ID ] = PlayerClass();

onPlayerSpawn( player )
Code: [Select]
if ( Stats[ player.ID ].Spawnloc ) player.Pos = Vector( Stats[ player.ID ].VectorX, Stats[ player.ID ].VectorY, Stats[ player.ID ].VectorZ ); //Making player spawn in his saved location if his spawnloc is on.

Commands
First Commands - With Setspawnloc
Code: [Select]
if ( cmd == "setspawnloc" )
{
 Stats[ player.ID ].VectorX = player.Pos.x.tofloat(); //Saving Vector X of player to his stats
 Stats[ player.ID ].VectorY = player.Pos.y.tofloat(); //Saving Vector Y of player to his stats
 Stats[ player.ID ].VectorZ = player.Pos.z.tofloat(); //Saving Vector Z of player to his stats
 MessagePlayer( "[#ffbb00]now use /spawnloc to make it on or off", player );
Announce( "~t~You has set your spawnloc here", player , 0 );
}

else if ( cmd == "spawnloc" )
{
 if ( !text ) MessagePlayer( "[#ffbb00]/" + cmd + " <on/off>", player );
 else {
 if ( text == "on" )
{
 Stats[ player.ID ].Spawnloc = true; //Making the spawnloc ready to use
Announce( "~t~Spawnloc Enabled", player , 0 );
 }
 else if ( text == "off" )
{
 Stats[ player.ID ].Spawnloc = false; //Changing the spawnloc to false
Announce( "~y~Spawnloc Disabled", player , 0 );
 }
 }
 }

Second Command - Setting when truring on
Code: [Select]
if ( cmd == "spawnloc" )
{
 if ( !text ) MessagePlayer( "[#ffbb00]/" + cmd + " <on/off>", player );
 else {
 if ( text == "on" )
{
 Stats[ player.ID ].VectorX = player.Pos.x.tofloat(); //Saving Vector X of player to his stats
 Stats[ player.ID ].VectorY = player.Pos.y.tofloat(); //Saving Vector Y of player to his stats
 Stats[ player.ID ].VectorZ = player.Pos.z.tofloat(); //Saving Vector Z of player to his stats
 Stats[ player.ID ].Spawnloc = true;  //Making the spawnloc ready to use
 MessagePlayer( "[#ffbb00]You has set your spawnloc here.", player );
Announce( "~t~Spawnloc Enabled", player , 0 );
 }
 else if ( text == "off" )
{
 Stats[ player.ID ].Spawnloc = false;  //Changing the spawnloc to false
Announce( "~y~Spawnloc Disabled", player , 0 );
 }
 }
 }



Second way - Database
onScriptLoad()
Code: [Select]
Spawnloc <- ConnectSQL( "SpawnLocations.db" ); //Making new database
QuerySQL( Spawnloc, "CREATE TABLE IF NOT EXISTS Accounts ( Name VARCHAR(32), VectorX VARCHAR(25), VectorY VARCHAR(25), VectorZ VARCHAR(25), Spawnloc TEXT )" ); //Creating tables

onPlayerSpawn(player)
Code: [Select]
local q = QuerySQL(Spawnloc, "SELECT * FROM Accounts WHERE Name = '" + player.Name + "'"); //Checking player name
if( q && GetSQLColumnData(q, 4) == "on" ) // if player has spawnloc on
{
local ppy = GetSQLColumnData(q, 2).tointeger(), //Making local for player Y which saved before in db
ppx = GetSQLColumnData(q, 1).tointeger(),  //Making local for player X which saved before in db
ppz = GetSQLColumnData(q, 3).tointeger();  //Making local for player Z which saved before in db
player.Pos = Vector( ppx, ppy, ppz); //Setting player place in spawnloc <saved> place.
}

Commands
First Commands - With Setspawnloc
Code: [Select]
if(cmd == "setspawnloc")
{
local q = QuerySQL(Spawnloc, "SELECT * FROM Accounts WHERE Name = '" + player.Name + "'"); //Getting player name from db
if(!q) QuerySQL(Spawnloc, "INSERT INTO Accounts ( Name, VectorX, VectorY, VectorZ, Spawnloc ) VALUES ( '" + player.Name + "', '0' , '0' , '0','null' ) "); // if player not in db make an place for him
else{
QuerySQL(Spawnloc, "UPDATE Accounts SET VectorX = '" + player.Pos.x + "' WHERE Name = '" + player.Name + "'"); //Saving X
QuerySQL(Spawnloc, "UPDATE Accounts SET VectorY = '" + player.Pos.y + "' WHERE Name = '" + player.Name + "'"); //Saving Y
QuerySQL(Spawnloc, "UPDATE Accounts SET VectorZ = '" + player.Pos.z + "' WHERE Name = '" + player.Name + "'"); //Saving Z
MessagePlayer( "[#ffbb00]You has set your spawnloc here.", player );
Announce( "~t~Spawnloc Enabled", player , 0 );
}
}
 
else if(cmd == "spawnloc")
{
if(!text) MessagePlayer("[#ff0000]/" + cmd + " <on/off>", player);
local q = QuerySQL(Spawnloc, "SELECT * FROM Accounts WHERE Name = '" + player.Name + "'"); //Getting player from db
if(!q) MessagePlayer("[#ffbb00]you didn't set your spawnloc yet, use /setspawnloc.", player); // if player didn't set his location
else
{
if(text == "on")
{
QuerySQL(Spawnloc, "UPDATE Accounts SET Spawnloc = 'on' WHERE Name = '" + player.Name + "'"); //Setting the spawnloc on
Announce( "~t~Spawnloc Enabled", player , 0 );
}
if(text == "off")
{
QuerySQL(Spawnloc, "UPDATE Accounts SET Spawnloc = 'off' WHERE Name = '" + player.Name + "'"); //Setting the spawnloc off
Announce( "~y~Spawnloc Disabled", player , 0 );
}
}
}

Second Command - All in /spawnloc
Code: [Select]
else if(cmd == "spawnloc")
{
if(!text) MessagePlayer("[#ff0000]/" + cmd + " <on/off>", player);
local q = QuerySQL(Spawnloc, "SELECT * FROM Accounts WHERE Name = '" + player.Name + "'"); //Getting player name from db
if(!q) QuerySQL(Spawnloc, "INSERT INTO Accounts ( Name, VectorX, VectorY, VectorZ, Spawnloc ) VALUES ( '" + player.Name + "', '0' , '0' , '0','null' ) "); // if player not in db make an place for him
else
{
if(text == "on")
{
QuerySQL(Spawnloc, "UPDATE Accounts SET Spawnloc = 'on' WHERE Name = '" + player.Name + "'"); //Spawnloc on
QuerySQL(Spawnloc, "UPDATE Accounts SET VectorX = '" + player.Pos.x + "' WHERE Name = '" + player.Name + "'"); //Saving X
QuerySQL(Spawnloc, "UPDATE Accounts SET VectorY = '" + player.Pos.y + "' WHERE Name = '" + player.Name + "'"); //Saving Y
QuerySQL(Spawnloc, "UPDATE Accounts SET VectorZ = '" + player.Pos.z + "' WHERE Name = '" + player.Name + "'"); //Saving Z
Announce( "~t~Spawnloc Enabled", player , 0 );
}
if(text == "off")
{
QuerySQL(Spawnloc, "UPDATE Accounts SET Spawnloc = 'off' WHERE Name = '" + player.Name + "'"); //Changing the Spawnloc to off
Announce( "~y~Spawnloc Disabled", player , 0 );
}
}
}

Hope it make my friends happy, Hope it make anyone happy, Hope it make you happy.
Have a nice day, love you all, yours...
Mahmoud Ashraf
7
Snippet Showroom / [Minigame] Maze Runners.
« on June 5th, 2018, 03:29 AM »
Hello, dear VC-MP community.
I was talking to some friends and they asked me to make an maze minigame, they said that they played one before.
So i was thinking and finally, i made it and now i would love to share it.
Idea: had been taken from anime's world server.

First:  PlayerClass, for making or checking if player is maze player.
Code: [Select]
mazerunner = false;

Second:  Scriptload, for making the maze false {didn't started yet}, and making the maze map.
Code: [Select]
maze <- false;
 mazecount <- 0;
 mazestart <- false;
 mazeobjects();
 print( "=== Maze Minigame Loaded ===" );

Third:  CreateMazeObjects
Code: [Select]
function mazeobjects();
{
CreateObject(1078,2,Vector(-382.707, -575.289, 1071.11),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-333.354, -594.997, 1071.3),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-425.653, -598.008, 1071.3),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-385.225, -600.134, 1071.3),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-395.847, -554.743, 1071.3),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(2505,2,Vector(-382.539, -577.317, 1073.05),255).RotateToEuler(Vector(3.14159, 3.14159, 1.5416),1)
CreateObject(2505,2,Vector(-429.002, -576.413, 1073.05),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-452.034, -582.818, 1071.3),255).RotateToEuler(Vector(0, 0, 1.55),1)
CreateObject(310,2,Vector(-421.297, -554.912, 1071.3),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(2505,2,Vector(-337.211, -572.848, 1073.02),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-314.453, -568.476, 1071.3),255).RotateToEuler(Vector(0, 0, 1.55),1)
CreateObject(310,2,Vector(-327.652, -551.383, 1071.3),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-333.015, -550.631, 1071.3),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-323.242, -550.807, 1071.3),255).RotateToEuler(Vector(3.14159, -3.14159, 1.5416),1)
CreateObject(310,2,Vector(-331.936, -545.814, 1071.3),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-340.61, -545.855, 1071.3),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-349.144, -545.831, 1071.3),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-357.863, -545.785, 1071.3),255).RotateToEuler(Vector(0, 0, 0),1)
CreateObject(310,2,Vector(-358.379, -550.907, 1071.3),255).RotateToEuler(Vector(0, 0, 1.45),1)
}

Fourth: When player have been killed or get disconnected, get out of the maze count.
Code: [Select]
function onPlayerKill( killer, player, reason, bodypart )
{
if ( Stats[ player.ID ].mazerunner )
{
mazecount--;
Message( "[#00de00]Minigame: [#fbf3f3]" + player.Name + " is out of the maze." );
if ( mazecount == 0 ) closemaze();
Stats[ player.ID ].mazerunner = false;
}
}

function onPlayerDeath( player, reason )
{
if ( Stats[ player.ID ].mazerunner )
{
mazecount--;
Message( "[#00de00]Minigame: [#fbf3f3]" + player.Name + " is out of the maze." );
if ( mazecount == 0 ) closemaze();
Stats[ player.ID ].mazerunner = false;
}
}


function onPlayerPart( player, reason )
{
if ( Stats[ player.ID ].mazerunner )
{
mazecount--;
Message( "[#00de00]Minigame: [#fbf3f3]" + player.Name + " is out of the maze." );
if ( mazecount == 0 ) closemaze();
Stats[ player.ID ].mazerunner = false;
}
}

Fifthly: Maze Commands, maze, joinmaze and startmaze.
Code: [Select]
if( Stats[player.ID].mazerunner ) return MessagePlayer( "[#00de00]Minigame: [#fbf3f3]You can't use commands while you playing in a maze.", player );
cmd = cmd.tolower ( );

if( cmd == "maze")
{
  if( maze ) MessagePlayer("[#00de00]Minigame: [#fbf3f3]maze is already started.. ",player);
  else
{
   maze = true;
   Message("[#00de00]Minigame: [#fbf3f3]"+ player.Name +" has asked for maze, 20sec to join him.");
   NewTimer( "mazetimer", 20000, 1);
}
}
 else if( cmd == "joinmaze")
{
 if ( !player.Spawned )MessagePlayer("[#00de00]Information: [#fbf3f3]Spawn to use this command" player);
 else if ( !maze ) MessagePlayer("[#00de00]Minigame: [#fbf3f3]maze is not started do /maze", player);
 else if ( Stats[player.ID].mazerunner ) MessagePlayer("[#00de00]Minigame: [#fbf3f3]You already a maze runner.",player);
 else if ( mazecount > 4 ) MessagePlayer("[#00de00]Minigame: [#fbf3f3]Too Late!", player);
 else if ( mazestart ) MessagePlayer("[#00de00]Minigame: [#fbf3f3]Too Late!", player);
 else {
  mazecount++;
   for( local i=0; i <= mazecount; i++ )
  {
   local plr = FindPlayer( i );
  }
  player.Frozen = true;
  Stats[player.ID].mazerunner = true;
  player.World = 2;
  player.CanAttack = false;
  player.Pos = Vector(-449.832, -579.169, 1075.8);
  Message("[#00de00]Minigame: [#fbf3f3]"+ player.Name +" has joined the maze.")
 }
 }
 else if( cmd == "startmaze")
{
 if ( !player.Spawned )MessagePlayer("[#00de00]Information: [#fbf3f3]Spawn to use this command" player);
 else if ( !maze ) MessagePlayer("[#00de00]Minigame: [#fbf3f3]maze is not started do /maze fisrt to start one.", player);
 else if ( !Stats[player.ID].mazerunner ) MessagePlayer("[#00de00]Minigame: [#fbf3f3]You aren't a maze runner to start it.",player);
 else if ( mazecount < 1 ) MessagePlayer("[#00de00]Minigame: [#fbf3f3]You can't start the maze, as you are only.", player);
 else if ( mazestart ) MessagePlayer("[#00de00]Minigame: [#fbf3f3]The maze is already started.", player);
 else {
 startmaze();
 }
 }

Sixth: Maze functions:
Code: [Select]
function startmaze()
{
    mazestart = true;
    CreatePickup(376, 2, 50, Vector(-355.151, -548.226, 1072.8), 255, true);
    local plr;
    for( local i=0; i <= GetMaxPlayers(); i++ )
{
{
    plr = FindPlayer( i );
    if ( ( plr ) && ( Stats[ plr.ID ].mazerunner ) )
{
    plr.IsFrozen = false;
}
}
}
}

function closemaze()
{
    maze = false;
    mazestart = false;
    mazecount = 0;
    local plr;
    for( local i=0; i <= GetMaxPlayers(); i++ ){
{
    plr = FindPlayer( i );
    if ( plr )
{
    if( Stats[ plr.ID ].mazerunner )
{
    Stats[ plr.ID ].mazerunner = false;
    plr.IsFrozen = false;
    plr.CanAttack = true;
    plr.World = 1;
    plr.Pos = Vector( 496, -84, 11  );
}
}
}
}
}

function mazetimer()
{
   if ( mazecount > 1 )
{
  NewTimer( "MAnn", 1000, 1, "3" );
  NewTimer( "MAnn", 3000, 1, "2" );
  NewTimer( "MAnn", 6000, 1, "1" );
  NewTimer( "MAnn", 7000, 1, "0" );
}
   else closemaze();
}

function MAnn( number )
{
       for( local i=0; i <= GetMaxPlayers(); i++ )
  {
   local plr = FindPlayer( i );
      if ( ( plr ) && ( Stats[ plr.ID ].mazerunner ) )
                        {
      switch( number.tointeger() )
          {
       case 0:
       startmaze();
       Announce( "Go!", plr );
       break;

       case 1:
       Announce( "1", plr );
       break;
       
       case 2:
       Announce( "2", plr );
       break;
       
       case 3:
       Announce( "3", plr );
       break;
          }
      }
  }
}

Seventh: onPickupPickedUp( player, pickup )
Code: [Select]
  if ( pickup.Model == 376 )
{
  if ( Stats[ player.ID ].mazerunner )
{
  IncCash( player, 5000 );
  MessagePlayer("[#00de00]Minigame: [#fbf3f3]Congratulation! You Got 5000$" player);
  pickup.Remove();
  player.World = 1;
  Message( "[#00de00]Minigame: [#fbf3f3]Congratulation! "+player.Name+" Has finished the maze." );
  closemaze();
}
}

Finally, hope that like you.
Your friend,
Mahmoud Ashraf.
8
Snippet Showroom / Basic Ban System
« on May 10th, 2018, 09:13 PM »
Hi Guys, As i will back to VC-MP again in 23/5 and i was making Ban system now.
I decide that i will share it, Enjoy!

onScriptLoad()
Code: [Select]
Bans <- ConnectSQL( "Bans.db" );
 QuerySQL( Bans, "CREATE TABLE IF NOT EXISTS Bans ( Name VARCHAR(32), IP VARCHAR(25), Admin TEXT, Reason TEXT, Time VARCHAR(255) DEFAULT CURRENT_TIMESTAMP)" );

onPlayerJoin( player )
Code: [Select]
CheckBan(player);   //Checking if the player banned or not.

Checkban Function
Code: [Select]
function CheckBan( player )
{
local q1 = QuerySQL( Bans, "SELECT * FROM Bans WHERE IP ='" +player.IP+"'") //Getting the database details
local ip = GetSQLColumnData(q1, 1) // Getting player ip
local name = GetSQLColumnData( q1, 0 ); // Getting player name
if (ip) KickPlayer(player)
else if (name) KickPlayer(player)
else if ( ip && name) KickPlayer( player)
else return 0
}

Baninfo function /which used in unban command.
Code: [Select]
function Baninfo( p )
{
   local q = QuerySQL( Bans, "SELECT * FROM Bans WHERE Name='" + p + "'" );
   local name = GetSQLColumnData( q, 0 );
   if ( name ) return 1;
   else return 0;
}

Commnads
Code: [Select]
      if ( cmd == "ban" )
      {
if( Stats[ player.ID ].Log == false ) MessagePlayer( "Inforamtion: You Need Login or Register First.", player );  // Check if the player registered and logged
else if ( Stats[ player.ID ].Level < 7 ) MessagePlayer("Inforamtion: You aren't authorized to use this command.", player ); // Check player level
else if ( !text ) MessagePlayer( "Syntax, /" + cmd + " <nick> <reason>", player ); // the syntax of the command
                else
{
local plr = GetPlayer( GetTok( text, " ", 1 ) ); //getplayer
if ( !plr ) MessagePlayer( "Information: Invalid Player Nick / ID!", player ); // if player not playing
else
{
local reason = GetTok( text, " ", 2 ); //get reason
local now = date(); // For the time date.
if ( reason == null ) reason = "None"; //if no reason return None
{
QuerySQL( Bans, "INSERT INTO Bans ( Name, IP, Admin, Reason, Time ) VALUES ( '" + plr.Name + "', '" + plr.IP + "', '" + player.Name + "', '" + reason + "', '"+ now.year +"/"+now.month+"/"+now.day+"/"+now.hour+":"+ now.min + "' )" ); //Add player to Ban List "added the time"
Message( "Administration Command: Admin " + player.Name + " Banned " + plr.Name + " for Reason: " + reason ); //Msg
KickPlayer( plr ); //kick player
}
}
}
}
else if ( cmd == "unban" )
{
if( Stats[ player.ID ].Log == false ) MessagePlayer( "Inforamtion: You Need Login or Register First.", player );  // Check if the player registered and logged
else if ( Stats[ player.ID ].Level < 7 ) MessagePlayer("Inforamtion: You aren't authorized to use this command.", player ); // Check player level
else if ( !text ) MessagePlayer( "Syntax, /" + cmd + " <Full Nick>", player ); //The Syntax of the command
else if ( Baninfo( text ) == 0 ) MessagePlayer( "Information:" + text + " is not Banned.", player ); //Check if player in banned list
else
{
  QuerySQL( Bans, "DELETE FROM Bans WHERE Name='" + text + "'" ); //Deleting player from the list
Message( "Administration Command: Admin " + player.Name + " UnBanned " +  text + "."); /msg
}
}

else if ( cmd == "baninfo" )
{
if ( !text ) MessagePlayer( "Inforamtion: /"+cmd+" <Full-Nick>", player );
else {
local q = QuerySQL( Bans, "SELECT * FROM Bans WHERE Name='" + text + "' COLLATE NOCASE" );
if ( GetSQLColumnData( q, 0 ) != text ) MessagePlayer( "Information: " + text + " is not Banned.", player );
else
{
MessagePlayer("BanInfo: Name("+GetSQLColumnData( q, 0 )+"), IP("+GetSQLColumnData( q, 1 )+"), Reason("+GetSQLColumnData( q, 3 )+"), Time("+GetSQLColumnData( q, 4 )+", BannedBy("+GetSQLColumnData( q, 2 )+").",player)
}
}
}

Thanks, Your Friend
MahmoudTornado

 :edit:
Adding Time, Checkban with Ip "By Helathien", baninfo command.
 :edit:
Fixing some small bugs.
9
Vehicle Showroom / Kurumi Tokisaki
« on March 23rd, 2018, 10:47 PM »
As, i will leave VC-MP for 2 months.
I decided to make something to my friend who helped me in all things.
@KuRiMi i made this car to you i wish you like it.

Download Link:
http://www.mediafire.com/file/m4l6851eogbzxgo






Make Sure That Veh Color Is Red.
10
Skin Showroom / GTA Vice City Barcelona Kit V.1.1
« on March 23rd, 2018, 10:11 PM »
GTA Vice City Barcelona Kit V.1.1
Original Author: Sparow
Original Link: http://www.gtainside.com/en/vicecity/skins/110352-barcelona-kit-v1-1/
ScreenShot:
Download Link: http://www.mediafire.com/file/araxqx7lskzal5s/z201_Barcelona.7z
11
Object Showroom / Kurumi Tokisaki Wallpaper
« on March 23rd, 2018, 09:03 PM »
As, i will leave VC-MP for 2 months.
I decided to make something to my friend who helped me in all things.
@KuRiMi I Made An Wallpaper i wish you like it.

Download Link:
http://www.mediafire.com/file/3wkqo74ost6mvb3/KurumiTokisaki.rar




And This In Main on Scriptload
Code: [Select]
CreateObject(6000,1,Vector(-311.501, -648.685, 9.35093),255)
12
As, i will leave VC-MP for 2 months.
I decided to make something here before.
When some friend asked me to make that i made it, Enjoy!

onScriptLoad() /// Loading Databases
Code: [Select]
pp <- ConnectSQL("Pickup.sqlite");
::QuerySQL( pp, "CREATE TABLE IF NOT EXISTS PickUpHeal ( PX FLOAT, PY FLOAT, PZ FLOAT )" );
::QuerySQL( pp, "CREATE TABLE IF NOT EXISTS PickUpArmour ( PX FLOAT, PY FLOAT, PZ FLOAT )" );
LoadPickUpHeal();
LoadPickUpArmour();

onScriptUnload()
Code: [Select]
DisconnectSQL( pp );

onPlayerCommand( player, cmd, text ) //Commands /addhealpickup /addarmourpickup
Code: [Select]
if ( cmd == "addhealpickup" )
 {
    CreatePickup( 366, Vector( player.Pos.x.tofloat(), player.Pos.y.tofloat(), player.Pos.z.tofloat() ) );
    QuerySQL( pp, "INSERT INTO PickUpHeal ( PX, PY, PZ ) VALUES ( '" + player.Pos.x.tofloat() + "', '" + player.Pos.y.tofloat() + "', '" + player.Pos.z.tofloat() + "' )" );
    Message(player.Name+": [#FFFFFF]PickUp Saved In Database.");
 }
else if ( cmd == "addarmourpickup" )
 {
    CreatePickup( 368, Vector( player.Pos.x.tofloat(), player.Pos.y.tofloat(), player.Pos.z.tofloat() ) );
    QuerySQL( pp, "INSERT INTO PickUpArmour ( PX, PY, PZ ) VALUES ( '" + player.Pos.x.tofloat() + "', '" + player.Pos.y.tofloat() + "', '" + player.Pos.z.tofloat() + "' )" );
    Message(player.Name+": [#FFFFFF]PickUp Saved In Database.");
 }

Load Pickup Functions /// To load the pickup when the server open
Code: [Select]
function LoadPickUpHeal()
{
 local q = QuerySQL( pp, "SELECT * FROM PickUpHeal" ), i = 0;
 while( GetSQLColumnData( q, 0 ) )
 {
  local
   PX= GetSQLColumnData( q, 0 ),
   PY = GetSQLColumnData( q, 1 ),
   PZ = GetSQLColumnData( q, 2 );
  CreatePickup( 366, Vector( PX.tofloat(), PY.tofloat(), PZ.tofloat() ) );
  GetSQLNextRow( q );
  i++;
 }
 print( "Heal PickUps loaded - " + i );
}

function LoadPickUpArmour()
{
 local q = QuerySQL( pp, "SELECT * FROM PickUpArmour" ), i = 0;
 while( GetSQLColumnData( q, 0 ) )
 {
  local
   PX= GetSQLColumnData( q, 0 ),
   PY = GetSQLColumnData( q, 1 ),
   PZ = GetSQLColumnData( q, 2 );
  CreatePickup( 368, Vector( PX.tofloat(), PY.tofloat(), PZ.tofloat() ) );
  GetSQLNextRow( q );
  i++;
 }
 print( "Armour PickUps loaded - " + i );
}

Pickup Function //Check Money And PlayerHp ----Then----> Timer.
Code: [Select]
function onPickupPickedUp( player, pickup )
{
if( pickup.Model == 366 )
{
if ( player.Health == 100 ) MessagePlayer( "[#00de00]Command: [#fbf3f3]Error - You don't need to be healed.", player );
else if ( player.Cash < 3000 ) MessagePlayer( "[#00de00]Command: [#fbf3f3]You Need 3k To Heal.", player );
else {
NewTimer( "heal", 3000, 1, player.ID );
Announce( "Healing...", player , 0 );
player.IsFrozen = true;
player.Cash -= 3000;
}
}
if( pickup.Model == 368 )
{
if ( player.Armour == 100 ) MessagePlayer( "[#00de00]Command: [#fbf3f3]Error - You don't need armour.", player );
else if ( player.Cash < 5000 ) MessagePlayer( "[#00de00]Command: [#fbf3f3]You Need 5k To Get Armour.", player );
else {
NewTimer( "armour", 3000, 1, player.ID );
Announce( "Getting Armour...", player , 0 );
player.IsFrozen = true;
player.Cash -= 5000;
}
}
}

After Timer
Code: [Select]
function heal(p)
{
local player = FindPlayer(p);
if (player) {
player.IsFrozen = false;
player.Health = 100;
MessagePlayer( "[#00de00]Information: [#fbf3f3]You Have Been Healed.", player );
}
}

function armour(p)
{
local player = FindPlayer(p);
if (player) {
player.IsFrozen = false;
player.Armour = 100;
MessagePlayer( "[#00de00]Information: [#fbf3f3]You Have Been Armoured.", player );
}
}

Getplayer , GetTok And NumTok Function.
Code: [Select]

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();
}
function GetPlayer( plr )
{
    if ( plr )
    {
        if ( IsNum( plr ) )
        {
            plr = FindPlayer( plr.tointeger() );
            if ( plr ) return plr;
            else return false;
        }
    else
        {     
            plr = FindPlayer( plr );
            if ( plr ) return plr;
            else return false;
        }
    }
    else return false;
}
13
Snippet Showroom / Anti-Spawn Kill or Spawn Kill Protection.
« on January 26th, 2018, 03:45 AM »
Hi friends.
i made Anti-Spawnkill Protection. so i wanna to share it.
Code: [Select]
class PlayerStats
{
AntiSP = false;
}

function onScriptLoad()
{
Stats <- array( GetMaxPlayers(), null );
}

function onPlayerSpawn( player )
{
SpawnKill( player );
}

function onPlayerJoin( player )
{
Stats[player.ID] = PlayerStats();
}

function onPlayerHealthChange( player, oldhp, newhp )
{
if ( Stats[ player.ID ].AntiSP )
{
player.Health = 100;
}
}

function onPlayerKill( killer, player, reason, bodypart )
{
if ( Stats[ player.ID ].AntiSP )
{
killer.Health = 0;
Message( "[#00de00]Information: [#fbf3f3]" + killer.Name + " Have Been Killed. Reason: Spawn-Kill." );
}
}

function SpawnKill( player )
{
 Stats[ player.ID ].AntiSP = true;
 NewTimer( "SpawnKillFalse", 3000, 1, player.ID );
 MessagePlayer( "[#00de00]Information: [#fbf3f3]Spawn protection enabled.", player );
}

function SpawnKillFalse(p)
{
  local player = FindPlayer(p);
  if (player)
  {
  Stats[ player.ID ].AntiSP = false;
  MessagePlayer( "[#00de00]Information: [#fbf3f3]Spawn protection disabled.", player );
}
}
Enjoy!
14
How To Change Generic.txd And Particle.txd.
15
Script and Content Requests / CELO
« on October 13th, 2017, 12:32 AM »
CELO Files Can Convet Like That ?

Code: [Select]
{$CLEO}
0000:

0AC6: [email protected] = label @Data offset

while true
wait 0
 for [email protected] = #LANDSTAL to #VICECHEE
  if and
    [email protected] <> #AIRTRAIN
    [email protected] <> #DEADDODO
    [email protected] <> #RCBARON
    [email protected] <> #RCRAIDER
    [email protected] <> #RCGOBLIN
  then 
    0ADB: [email protected] = car_model [email protected] name 
    if
        0ADC: test_cheat [email protected]
    then
        0ADD: spawn_car_with_model [email protected] at_player_location
        0ACE: show_formatted_text_box "%s spawned..." [email protected]
    end
  end 
 end
end

:Data   
hex
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
end