Motor startet nicht, woran liegt das ?
Code
if(strcmp(cmdtext,"/motor",true) == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
State=GetPlayerState(playerid);
if(IsPlayerConnected(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new newcar = GetPlayerVehicleID(playerid);
new vid = GetPlayerVehicleID(playerid);
if(motor[vid] == false)
{
if(PlayerInfo[playerid][pRest] == 1)
{
new Bootcar = GetPlayerVehicleID(playerid);
for(new X = 0; X < MaxVeh; X++)
{
if (Bootcar == PlayerCar[playerid][X][CarId])
{
if(PlayerCar[playerid][X][CarArrest] == 1)
{
SendClientMessage(playerid, COLOR_WHITE,"Du kannst nicht wegfahren, da an den Reifen eine Wegfahrsperre angebracht ist!");
CarWarn[playerid] = 1;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
motor[vid] = false;
SendClientMessage(playerid,COLOR_GREY,"Motor abgeschaltet(Wegfahren fehlgeschlagen!)");
FreezePlayer(playerid);
GameTextForPlayer(playerid,"~g~/exit ~w~um auszusteigen",2000,1);
return 1;
}
}
}
}
if(vid == PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId])
{
for(new X = 0; X < MaxVeh; X++)
if(PlayerCar[playerid][X][CarArrest] == 0)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
motor[vid] = true;
SendClientMessage(playerid,COLOR_GREY,"Motor wird gestartet..");
}
}
Alles anzeigen