Abend Com,
wie mache ich mein Motor system zu einem Licht system
new bool:Licht[MAX_VEHICLES]=false;
dcmd_licht(playerid,params[])
{
#pragma unused params
if(GetPlayerVehicleSeat(playerid) == 0)
{
new car = GetPlayerVehicleID(playerid);
if(GetVehicleModel(car) == 509 || GetVehicleModel(car) == 481 || GetVehicleModel(car) == 510)
{
SendClientMessage(playerid, Rot, "Du sitzt auf einem Fahrrad. Das hat keinen Licht!");
}
else if (Licht[car] == false)
{
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(car,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
Licht[car] = true;
}
else
{
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(car,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
Licht[car] = false;
}
}
return 1;
}
hier muss ich nur noch licht zu machen oder
for (new i=0; i< MAX_VEHICLES; i++)
{
GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(i,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
Motor[i] = false;
Licht[i] = false;
}
public OnVehicleSpawn(vehicleid)
{
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
Motor[vehicleid] = false;
Licht[vehicleid] = false;
return 1;
}
MFG Cake