Zuerstmal das hier ganz oben im Script:
new bool:Licht[MAX_VEHICLES]=false;
Dann unter OnGameModeInit:
for (new i=0; i< MAX_VEHICLES; i++)
{
GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objectives);
SetVehicleParamsEx(i,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objectives);
Licht[i] = false;
}
und
ManualVehicleEngineAndLights();
Und zu guter Letzt der Befehl:
if(strcmp(cmdtext, "/licht",true) == 0)
{
new car = GetPlayerVehicleID(playerid);
if(Licht[car] == false)
{
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objectives);
SetVehicleParamsEx(car,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objectives);
Licht[car] = true;
}
else if(Licht[car] == false)
{
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objectives);
SetVehicleParamsEx(car,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objectives);
Licht[car] = false;
}
return 1;
}
}
Sollte funktionieren...