ocmd:flock(playerid, params[])
{
for(new x;x<sizeof(fCar); x++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, fCar[x][fx], fCar[x][fy], fCar[x][fz]))
{
if(Locked[fCar[x][fvID]] == false)
{
new tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective;
GetVehicleParamsEx(fCar[x][fvID], tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
SetVehicleParamsEx(fCar[x][fvID], tmp_engine, tmp_lights, tmp_alarm, 1, tmp_bonnet, tmp_boot, tmp_objective);
Locked[fCar[x][fvID]] = true;
GameTextForPlayer(playerid, "~r~Abgeschlossen", 2000, 5);
return 1;
}
else if(Locked[fCar[x][fvID]] == true)
{
new tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective;
GetVehicleParamsEx(fCar[x][fvID], tmp_engine, tmp_lights, tmp_alarm, tmp_doors, tmp_bonnet, tmp_boot, tmp_objective);
SetVehicleParamsEx(fCar[x][fvID], tmp_engine, tmp_lights, tmp_alarm, 0, tmp_bonnet, tmp_boot, tmp_objective);
Locked[fCar[x][fvID]] = false;
GameTextForPlayer(playerid, "~g~Aufgeschlossen", 2000, 5);
return 1;
}
}
}
return scm(playerid, COLOR_RED, "Fehler du bist nicht in der nähe eines Fraktions-Fahrzeuges!");
}
So dürfe es passen.