30/05/2021 12:48
(29/05/2021 14:50)OTAKEIRO Escreveu:Não deu nenhum erro mas não funciono os farois nao piscaCreio que isso deve ajudar!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;
}