Code:
#include <natives.h>
#include <common.h>
#include <consts.h>
#include <types.h>
#include <strings.h>
void funnycar(void)
{
// This will be the vehicle that will be spawned. Check /inc/consts.h line 618 for vehicle model's.
uint vehicle_model = MODEL_AIRTUG ;
// The coords the vehicle will spawn in.
// For this example it will spawn it +10 away from the current player coords.
float spawn_x, spawn_y, spawn_z;
GET_CHAR_COORDINATES(GetPlayerPed(), &spawn_x, &spawn_y, &spawn_z);
REQUEST_MODEL(vehicle_model);
// Wait for the requested model to load. Otherwise it will crash if we try to use CREATE_CAR on the model.
while (!HAS_MODEL_LOADED(vehicle_model)) WAIT(0);
// This makes so the car won't spawn in traffic but it may still spawn parked.
// Actually create the car. Store it in v_spawn.
// The last parameter sets if we want to use collision detection.
// Use false if you want to spawn it exactly where you want it to.
Vehicle v_spawn;
CREATE_CAR(vehicle_model, spawn_x, spawn_y, spawn_z, &v_spawn, true);
SET_CAR_ENGINE_ON(v_spawn, 0, true);
WARP_CHAR_INTO_CAR(GetPlayerPed(), v_spawn);
// Sets the vehicle heading
// Not needed for this example as we use usng collision detection to auto place the car.
//SET_CAR_HEADING(v_spawn, 180.0000);
MARK_MODEL_AS_NO_LONGER_NEEDED(v_spawn);
// Saves the car so it will not disappear.
SET_CAR_AS_MISSION_CAR(v_spawn);
SET_CAR_VISIBLE(v_spawn, false); // change too true so you may see the car Anon
// First & Second Color
CHANGE_CAR_COLOUR(v_spawn, 135, 0);
// Specular Color
SET_EXTRA_CAR_COLOURS(v_spawn, 135, 0);
// Clean the vehicle.
SET_VEHICLE_DIRT_LEVEL(v_spawn, 0);
WASH_VEHICLE_TEXTURES(v_spawn, 255);
GET_CAR_CHAR_IS_USING(GetPlayerPed(), &v_spawn);
SET_CAR_CAN_BE_DAMAGED(v_spawn, false);
SET_CAR_CAN_BE_VISIBLY_DAMAGED(v_spawn, false);
SET_CAN_BURST_CAR_TYRES(v_spawn, false);
SET_HELI_BLADES_FULL_SPEED(v_spawn);
if (IS_CHAR_IN_ANY_CAR(GetPlayerPed()))
{
Vehicle v_spawn;
GET_CAR_CHAR_IS_USING(GetPlayerPed(), &v_spawn);
Ped Pped = GetPlayerPed();
Object NeonLight;
//add an object hash in the first parameter
{
CREATE_OBJECT(0xH45H ,0,0,0,&NeonLight,1);
WAIT(100);
//X: Pos X, Y: Pos Hieght, Z: Pos Width, Last 3 X Y Z's are Rotation Measurments
ATTACH_OBJECT_TO_CAR(NeonLight,v_spawn,0,X,Y,Z,rX,rY,rZ);
SET_OBJECT_VISIBLE(NeonLight, true);
WAIT(5000);
FREEZE_OBJECT_POSITION(NeonLight, true);
WAIT(5000);
SET_OBJECT_COLLISION(NeonLight, true);
//PRINT_STRING_WITH_LITERAL_STRING_NOW("string","Activation Text",5000,1);
}
}
}
void main(void){
THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
funnycar();
}
I am making my own little menu of Funny Cars right now actually, so if you get anything cool, please share