Hey Breadfish.
Im Script was ich gerade ein bisschen editen möchte ist eingestellt, dass man mit NUM 2 den Motor starten kann und mit NUM 8 das Licht anmachen kann. Doch wie kann ich mit dem folgenden Codes mit normaler 2 Taste und normaler 8 Taste die Funktionen machen?
Motor:
if((newkeys == KEY_ANALOG_DOWN)&&(IsPlayerInAnyVehicle(playerid)))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(Motor[vehicleid] == false && IsPlayerDriver(playerid))
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
new string[128];
format(string,sizeof(string),"%s startet den Motor.",SpielerName(playerid));
SendClientMessageInRange(playerid,string,cLila,50);
Motor[vehicleid] = true;
return 1;
}
if(Motor[vehicleid] == true && IsPlayerDriver(playerid))
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
new string[128];
format(string,sizeof(string),"%s schaltet den Motor aus.",SpielerName(playerid));
SendClientMessageInRange(playerid,string,cLila,50);
Motor[vehicleid] = false;
return 1;
}
}
Licht:
if((newkeys == KEY_ANALOG_UP)&&(IsPlayerInAnyVehicle(playerid)))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(Licht[vehicleid] == false && IsPlayerDriver(playerid))
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
Echo(playerid,cRot,"Licht an.");
Licht[vehicleid] = true;
return 1;
}
if(Licht[vehicleid] == true && IsPlayerDriver(playerid))
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
Echo(playerid,cRot,"Licht aus.");
Licht[vehicleid] = false;
return 1;
}
}
return 1;
}