Sehr geehrte SA:MP User,
Ich brauche ihre Hilfe, es geht um folgenden Befehl:
#include <a_samp>public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/cveh",true)==0)
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, 0xCC0000FF, "Um diesen Befehl zu nützen können , müssen sie in einen Fahrzeug sein.");
}
else
{
ShowPlayerDialog(playerid, 7474, DIALOG_STYLE_LIST, "Car Control", "Lichter ( Auf/zu )\nMotorhaube ( Auf/zu )\nKofferraum ( Auf/zu )\nMotor ( Auf/zu )\nAlarm ( Auf/zu )", "Ok", "Abbrechen");
}
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new veh = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
if(dialogid == 7474)
{
if(!response) return SendClientMessage(playerid, 0xCC0000FF, "Kontrol Abgebrochen.");
switch(listitem)
{
case 0:
{
if(GetPVarInt(playerid, "lichter") == 0)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "lichter", 1);
}
else if(GetPVarInt(playerid, "lichter") == 1)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "lichter", 0);
}
}
case 1:
{
if(GetPVarInt(playerid, "Motorhaube") == 0)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
SetPVarInt(playerid, "Motorhaube", 1);
}
else if(GetPVarInt(playerid, "Motorhaube") == 1)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
SetPVarInt(playerid, "Motorhaube", 0);
}
}
case 2:
{
if(GetPVarInt(playerid, "Kofferraum") == 0)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
SetPVarInt(playerid, "Kofferraum", 1);
}
else if(GetPVarInt(playerid, "Kofferraum") == 1)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
SetPVarInt(playerid, "Kofferraum", 0);
}
}
case 4:
{
if(GetPVarInt(playerid, "motor") == 0)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "motor", 1);
}
else if(GetPVarInt(playerid, "motor") == 1)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
SetPVarInt(playerid, "motor", 0);
}
}
case 5:
{
if(GetPVarInt(playerid, "Alarm") == 0)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
SetPVarInt(playerid, "Alarm", 1);
}
else if(GetPVarInt(playerid, "Alarm") == 1)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
SetPVarInt(playerid, "Alarm", 0);
}
}
}
return 1;
}
return 0; }
Wenn ich den Befehl benutze, öffnet sich ein Dialog. -> Alles okay.
Dennoch funktoniert die Auswahl "Motor" nicht.
Wenn ich "Motor" klicke, passiert garnichts.
Wenn ich "Alarm" drücke, startet der Motor.
Wodran liegt das und was muss ich nun tun?
Liebe Grüße
Mr.X