public OnVehicleSpawn(vehicleid) //
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
Locked[vehicleid] = false;
SetVehicleParamsEx(vehicleid, 0, 0, alarm, doors, bonnet, boot, objective);
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
for(new i=0; i<sizeof(AutosOhneMotor); i++)
{
new vModel=GetVehicleModel(vehicleid);
if(AutosOhneMotor[i]==vModel)continue;
if(Locked[vehicleid] == true)
{
new tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective;
GetVehicleParamsEx(vehicleid, tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
SetVehicleParamsEx(vehicleid, tmp_engine, tmp_lights, tmp_alarm, 0, tmp_bonnet, tmp_boot, tmp_objective);
Locked[vehicleid] = false;
}
break;
}
return 1;
}
CMD:lock(playerid, params[])
{
#pragma unused params
for(new xi=0; xi<sizeof(cInfo); xi++)
{
if(cInfo[xi][besitzer] != sInfo[playerid][db_id])continue;
if(cInfo[xi][besitzer] == sInfo[playerid][db_id])
{
new vehicleid=cInfo[xi][id_x];
new Float:xPos[3];
GetVehiclePos(vehicleid, xPos[0], xPos[1], xPos[2]);
if(IsPlayerInVehicle(playerid, vehicleid))continue;
if(Locked[vehicleid] == false)
{
new tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective;
GetVehicleParamsEx(vehicleid, tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
SetVehicleParamsEx(vehicleid, tmp_engine, tmp_lights, tmp_alarm, 1, tmp_bonnet, tmp_boot, tmp_objective);
Locked[vehicleid] = true;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Du hast das Fahrzeug abgeschlossen.");
return 1;
}
else if(Locked[vehicleid] == true)
{
new tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective;
GetVehicleParamsEx(vehicleid, tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
SetVehicleParamsEx(vehicleid, tmp_engine, tmp_lights, tmp_alarm, 0, tmp_bonnet, tmp_boot, tmp_objective);
Locked[vehicleid] = false;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Du hast das Fahrzeug aufgeschlossen.");
return 1;
}
}
}
return 1;
}