Hey, ich hab versucht den motor ueber eine Taste starten zu lassen, und zwar nur wenn man die Taste los laesst, jedoch geht der motor immer wieder an & aus wenn man keine andere Taste drueckt
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((oldkeys & KEY_ANALOG_DOWN) && !(newkeys & KEY_ANALOG_DOWN))
{
new vhd,engine,lights,alarm,doors,bonnet,boot,objective;
vhd = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vhd,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == 0 || engine== -1)
{
SetVehicleParamsEx(vhd,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid,"~w~Motor: ~g~An",1000,4);
}
}
if((oldkeys & KEY_ANALOG_DOWN) && !(newkeys & KEY_ANALOG_DOWN))
{
new vhd,engine,lights,alarm,doors,bonnet,boot,objective;
vhd = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vhd,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == 1)
{
SetVehicleParamsEx(vhd,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid,"~w~Motor: ~r~Aus",1000,4);
}
}
return 1;
}