14.05.2017, 19:07
Hey! I just wanted to ask if it's possible to make it so when a player unlocks his car, that it sets the car lights on then off immediately - just to add a little flash effect on the vehicle lights.
Here is the code.
Thank you.
Here is the code.
PHP код:
CMD:lock(playerid, params[])
{
new str[128], id = GetNearestVehicle(playerid, 15.0);
if(id != INVALID_VEHICLE_ID)
{
if (Vehicles[id][Owner] == Character[playerid][ID])
{
if(Vehicles[id][Locked] == 0) // IF IT ISNT LOCKED
{
SetVehicleParamsEx(id, Engine[id], Lights[id], alarm[id], 1, bonnet[id], boot[id], objective[id]);
doors[id] = 1;
PlayerPlaySound(playerid, 1053, 0.0, 0.0, 10.0);
GameTextForPlayer(playerid, "LOCKED", 2000, 4);
// Lock the vehicle status
Vehicles[id][Locked] = 1;
}
else if (Vehicles[id][Locked] == 1) // IF IT IS LOCKED
{
SetVehicleParamsEx(id, Engine[id], Lights[id], alarm[id], 0, bonnet[id], boot[id], objective[id]);
doors[id] = 0;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 10.0);
GameTextForPlayer(playerid, "UNLOCKED", 2000, 4);
// Vehicle lights flash here once
// Unlock the vehicle status
Vehicles[id][Locked] = 0;
}
}