[Commands] Some Command For Cars

Started by Mohamed Boubekri, Dec 12, 2017, 12:51 PM

Previous topic - Next topic

Mohamed Boubekri

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


| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].


Mohamed Boubekri

| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Bninin...

mohamed plz tell me how to download ?

Humzasajjad


Derwaish.

For god sake please stop copying and spamming.

umar4911

Quote from: Humzasajjad on Sep 01, 2018, 11:10 PMWhere to paste these scripts?
these are commands so you need to paste these inside the function onPlayerCommand

Since you are newbie, visit wiki for more info
RT Member | Asian City Scripter | CTB Contributor | VKs Contributor | European City Contributor | EAD Scripter