VC:MP Create Car ( And Moded Cars )

Started by [M4]Shikri_M4, Dec 23, 2022, 08:43 PM

Previous topic - Next topic

[M4]Shikri_M4

Hi Guys :D! I Maked /addcar And /delcar For Admins O:-), Its Good To Use The Code And Eazy ;D!
Here İs Code:

if( cmd == "Delcar" || cmd == "delcar" )
{
local vehicle =  player.Vehicle;
if ( !vehicle )
{
MessagePlayer( "[#ff0000][ERROR]: [#ffffff]You Need Be In Vehicle.", player);
}
else
{
vehicle.Remove();
MessagePlayer( "[#00ff00]Succesfuly [#ffffff]Vehicle Deleted !", player );
}
}

if( cmd == "Addcar" || cmd == "addcar")
{
if(!text) MessagePlayer("[#ff0000][VEHICLE]: [#ffffff]/"+cmd+" <Model>",player);
else {
local car_id = text.tointeger();
local angle = player.Angle - (PI / 2);
local x1 = player.Pos.x;
local y1 = player.Pos.y;
local radius = 5;
local x2 = x1 - radius * cos(angle);
local y2 = y1 - radius * sin(angle)
local z2 = player.Pos.z;
local vehicle_angle = angle * -1;
CreateVehicle(car_id, player.World, x2, y2, z2, vehicle_angle, 68, 39);
Message( "[#ff0000][INFO]: [#00ff00]" + player.Name + " Created " + text + " Vehicle Model !" );
}
}

Good Luck 8)