29/05/2021 14:50
(Esta mensagem foi modificada pela última vez a: 29/05/2021 14:58 por OTAKEIRO.)
Código:
new bool:gfx_farol[MAX_VEHICLES];
public OnPlayerUpdate(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new veiculo = GetPlayerVehicleID(playerid);
if(gfx_farol[veiculo]) ToggleVehicleLights(veiculo);
}
return 1;
}
stock ToggleVehicleLights(vid)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
if(lights == VEHICLE_PARAMS_UNSET || lights == VEHICLE_PARAMS_OFF) SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
else SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
}
CMD:piscarfarol(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new veiculo = GetPlayerVehicleID(playerid);
if(gfx_farol[veiculo]) gfx_farol[veiculo] = false;
else gfx_farol[veiculo] = true;
}
return 1;
}