Hallo, Community.
Irgendwie funktioniert das Befehl "/motor" nicht..
Was kann ich tun bzw. wisst ihr vielleicht wo der Fehler liegt?
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)
{
//new PlayerName[MAX_PLAYER_NAME];
//GetPlayerName(playerid, PlayerName,sizeof(PlayerName));
//print("[INFO CAR(ENGINE)]:%s versucht den Motor von dem Auto[ID %s] zu starten",PlayerName,GetPlayerVehicleID(playerid));
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])
{
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..");
}
if(IsADrugCar(newcar))
{
if(PlayerInfo[playerid][pJob] == 4)
{
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..");
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "* %s startet den Motor", pname);
SetPlayerChatBubble(playerid, string,COLOR_PURPLE,40,2000);
}
else
{
Bitte um Hilfe!
Danke im voraus!
Mit freundlichen Grüßen,
Cripain