hallo habe ein problem das ist so ich kann bei booten helis und flugzeuge den moter nicht starten weiß nicht warum
public KmHUpdate(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
new string[125];
if(GetVehicleTank(vehicleid) == 0)
{
format(string,sizeof string,"~n~~w~KM/h: %i",floatround(GetVehicleSpeed(vehicleid,0)));
}
else
{
if(Tank[vehicleid] < 10) format(string,sizeof string,"~w~Tank: ~r~%i/%i~n~~w~KM/h: %i",Tank[vehicleid],MaxTank[GetVehicleModel(vehicleid)-400],floatround(GetVehicleSpeed(vehicleid,0)));
else if(Tank[vehicleid] < 30) format(string,sizeof string,"~w~Tank: ~y~%i/%i~n~~w~KM/h: %i",Tank[vehicleid],MaxTank[GetVehicleModel(vehicleid)-400],floatround(GetVehicleSpeed(vehicleid,0)));
else if(Tank[vehicleid] <= 100) format(string,sizeof string,"~w~Tank: ~g~%i/%i~n~~w~KM/h: %i",Tank[vehicleid],MaxTank[GetVehicleModel(vehicleid)-400],floatround(GetVehicleSpeed(vehicleid,0)));
}
TextDrawSetString(Anzeige[playerid],string);
return 1;
}
public CheckGas()
{
for(new veh;veh<MAX_VEHICLES;veh++)
{
if(GetVehicleTank(veh) == 1)
{
new ENGINE,LIGHTS,ALARM,DOORS,BONNET,BOOT,OBJECTIVE;
GetVehicleParamsEx(veh,ENGINE,LIGHTS,ALARM,DOORS,BONNET,BOOT,OBJECTIVE);
if(ENGINE == VEHICLE_PARAMS_ON)
{
if(Tank[veh] >= 1)
{
if(IsARoller(GetVehicleModel(veh))) ReachedMinusTank[veh] += 1;
else ReachedMinusTank[veh] += 2;
if(ReachedMinusTank[veh] == 400)
{
Tank[veh] -= 1;
ReachedMinusTank[veh] = 0;
}
}
else SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,ALARM,DOORS,BONNET,BOOT,OBJECTIVE);
}
}
else if(GetVehicleTank(veh) == 2)
{
new ENGINE,LIGHTS,ALARM,DOORS,BONNET,BOOT,OBJECTIVE;
GetVehicleParamsEx(veh,ENGINE,LIGHTS,ALARM,DOORS,BONNET,BOOT,OBJECTIVE);
if(ENGINE == VEHICLE_PARAMS_ON)
{
ReachedMinusTank[veh] += 1;
if(ReachedMinusTank[veh] == 200)
{
Tank[veh]-=1;
}
else SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,ALARM,DOORS,BONNET,BOOT,OBJECTIVE);
}
}
}
return 1;
}
forward IsACar2(model);
forward IsABoat2(model);
forward IsAPlane2(model);
forward IsAHelicopter2(model);
forward IsABike2(model);
forward IsATrain2(model);
forward IsATrailer2(model);
forward IsAFahrrad2(model);
forward IsARoller(model);
forward IsALKW2(model);
forward GetVehicleTank(vehicleid);
public GetVehicleTank(vehicleid)
{
new model = GetVehicleModel(vehicleid);
if(IsACar2(model) || IsARoller(model) || IsALKW2(model)) return 1;
else if(IsAHelicopter2(model) || IsAPlane2(model) || IsABoat2(model)) return 2;
else return 0;
}
public IsACar2(model)
{
if(IsABoat2(model)) return 0;
if(IsAPlane2(model)) return 0;
if(IsAHelicopter2(model)) return 0;
if(IsABike2(model)) return 0;
if(IsATrain2(model)) return 0;
if(IsATrailer2(model)) return 0;
if(IsALKW2(model)) return 0;
if(IsAFahrrad2(model)) return 0;
if(IsARoller(model)) return 0;
return 1;
}
public IsALKW2(model)
{
if(model == 403 || model == 406 || model == 407 || model == 408 || model == 414 || model == 416 || model == 427 || model == 428 || model == 431 || model == 433 || model == 437 ||
model == 443 || model == 444 || model == 455 || model == 456 || model == 482 || model == 495 || model == 498 || model == 499 || model == 508 || model == 514 || model == 515 || model == 524 ||
model == 525 || model == 528 || model == 532 || model == 544 || model == 556 || model == 557 || model == 573 || model == 578 || model == 582 || model == 588 || model == 601 || model == 609) return 1;
return 0;
}
public IsAFahrrad2(model)
{
if(model == 509 || model == 481 || model == 510) return 1;
return 0;
}
public IsARoller(model)
{
if(model == 462) return 1;
return 0;
}
public IsABoat2(model)
{
if(model == 472 || model == 473 || model == 493 || model == 595 || model == 484 || model == 430 || model == 453 || model == 452 || model == 446 || model == 454) return 1;
return 0;
}
public IsAPlane2(model)
{
if(model == 592 || model == 577 || model == 511 || model == 512 || model == 593 || model == 520 || model == 553 || model == 476 || model == 519 || model == 460 || model == 513) return 1;
return 0;
}
public IsAHelicopter2(model)
{
if(model == 548 || model == 417 || model == 487 || model == 488 || model == 497 || model == 563 || model == 447 || model == 469 || model == 425) return 1;
return 0;
}
public IsABike2(model)
{
if(model == 581 || model == 521 || model == 463 || model == 522 || model == 461 || model == 448 || model == 471 || model == 468 || model == 586 || model == 523) return 1;
return 0;
}
public IsATrain2(model)
{
if(model == 537 || model == 538 || model == 449) return 1;
return 0;
}
public IsATrailer2(model)
{
if(model == 435 || model == 450 || model == 591 || model == 606 || model == 607 || model == 610 || model == 569 || model == 590 || model == 584 || model == 570 || model == 608 || model == 611) return 1;
return 0;
}
if(strcmp(cmdtext,"/motor",true)==0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
{
if(!Tank[GetPlayerVehicleID(playerid)] && MaxTank[GetVehicleModel(GetPlayerVehicleID(playerid))-400] != -255)
{
SendClientMessage(playerid,Farbe_Grau,"Das Fahrzeug hat kein Benzin mehr!");
return 1;
}
if(IsAFahrrad2(GetVehicleModel(GetPlayerVehicleID(playerid))))
{
SendClientMessage(playerid,0xFF0000FF,"Das ist ein Fahrrad, das hat keinen Motor O.o");
return 1;
}
new ENGINE,LIGHTS,ALARM,DOORS,BONNET,BOOT,OBJECTIVE;
GetVehicleParamsEx(GetPlayerVehicleID(playerid),ENGINE,LIGHTS,ALARM,DOORS,BONNET,BOOT,OBJECTIVE);
if(ENGINE == VEHICLE_PARAMS_ON)
{
SendClientMessage(playerid,Farbe_Weiß,"** Motor abgeschaltet.");
SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_OFF,LIGHTS,ALARM,DOORS,BONNET,BOOT,OBJECTIVE);
}
else
{
SendClientMessage(playerid,Farbe_Weiß,"** Motor gestartet.");
SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_ON,LIGHTS,ALARM,DOORS,BONNET,BOOT,OBJECTIVE);
}
}
}
return 1;
}
Es kommt aber immer die meldung moter ist gestartet aber es passiert bei booten helis und flugzeugen nix why