/carlock geht nicht

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo liebe Community ich suche jemanden der mir über TeamViewer den /carlock bug fixt da es mit code nicht geht D:


    Der Bug: Ja ganz einfach wenn ich /carlock eintippe kommt du hast kein Auto(richtiger carkey ausgewählt) nunja wäre nett wenn wer helfen kann einfach auf unseren Ts kommen


    TS3:85.236.105.19:11187(Ansprechpartner: CHAOS)


    MFG


    CHAOS


    PS : einfach anstupsen

  • CODE:
    if (strcmp("/carhelp", cmdtext, true, 10) == 0)
    {
    SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
    SendClientMessage(playerid, COLOR_WHITE,"*** Commands *** /park /carlock /carkey /carsell");
    return 1;
    }
    if(strcmp("/carsell", cmdtext, true, 10) == 0)
    {
    if(Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    GivePlayerMoney(playerid, PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPreis]);
    Dtc_Carlock[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]] = 0;
    Dtc_UnLockCar(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]);
    DestroyObject(sirene[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]]);
    sirenean[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]] = false;
    DestroyVehicle(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]);
    new string3[32];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "/Autos/%s%d.dtcar", playername3,Dtc_PlayerKey[playerid]);
    fremove(string3);
    Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]] = 0;
    SendClientMessage(playerid, COLOR_YELLOW, " Fahrzeug erfolgreich verkauft, Hälfte des Kaufpreises wird wurde dir wieder gegeben!");
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du besitzt Kein Fahrzeug!");
    return 1;
    }
    return 1;
    }
    if (strcmp("/park", cmdtext, true, 10) == 0)
    {
    if(Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    new newcar = GetPlayerVehicleID(playerid);
    if (newcar == PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId])
    {
    new Float:X,Float:Y,Float:Z;
    new Float:z_rot;
    GetPlayerPos(playerid, X,Y,Z);
    GetVehicleZAngle(newcar, z_rot);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_x] = X;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_y] = Y;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_z] = Z;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarRotate] = z_rot;
    SendClientMessage(playerid, COLOR_YELLOW, " Du hast dein Fahrzeug hier geparkt, ab nun kannst du dein Fahrzeug hier finden!");
    }
    else
    {
    SendClientMessage(playerid,COLOR_GREY," Du bist nicht in deinem Fahrzeug/Du hast nicht den Schlüssel zu diesem Fahrzeug ausgewählt!");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du besitzt Kein Fahrzeug für deinen Ausgewählten Schlüssel!");
    return 1;
    }
    return 1;
    }
    if (strcmp("/carlock", cmdtext, true, 10) == 0)
    {
    if(Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    new Status = Dtc_Carlock[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]];
    new Float:dtc_X,Float:dtc_Y,Float:dtc_Z;
    GetVehiclePos(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId],dtc_X,dtc_Y,dtc_Z);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,20.0,dtc_X,dtc_Y,dtc_Z))
    {
    PlayerPlaySound(i,1147,dtc_X,dtc_Y,dtc_Z);
    }
    }
    switch (Status)
    {
    case 0:
    {
    GameTextForPlayer(playerid, "~w~Fahrzeug ~r~abgeschlossen", 5000, 6);
    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
    Dtc_Carlock[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]] = 1;
    Dtc_LockCar(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]);
    }
    case 1:
    {
    GameTextForPlayer(playerid, "~w~Fahrzeug ~g~aufgeschlossen", 5000, 6);
    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
    Dtc_Carlock[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]] = 0;
    Dtc_UnLockCar(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]);
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du besitzt Kein Fahrzeug für deinen Ausgewählten Schlüssel!");
    return 1;
    }
    return 1;
    }
    if (strcmp("/carkey", cmdtext, true, 10) == 0)
    {
    new mv = MaxVeh;
    if(mv > 1)
    {
    Dtc_PlayerKey[playerid] += 1;
    if(Dtc_PlayerKey[playerid] == MaxVeh)
    {
    Dtc_PlayerKey[playerid] = 0;
    }
    if(Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    format(string, sizeof(string), "Du nimmst deinen %dten Auto-Schlüssel, für deinen %s!",Dtc_PlayerKey[playerid]+1,CarName[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarModel]-400]);
    }
    else
    {
    format(string, sizeof(string), "Du nimmst deinen %dten Auto-Schlüssel, doch hast für diesen Schlüssel noch kein Auto!",Dtc_PlayerKey[playerid]+1);
    }
    SendClientMessage(playerid,COLOR_YELLOW,string);
    }
    return 1;
    }

  • Das es so aussieht:


    if (strcmp("/carhelp", cmdtext, true, 10) == 0)
    {
    SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
    SendClientMessage(playerid, COLOR_WHITE,"*** Commands *** /park /carlock /carkey /carsell");
    return 1;
    }
    if(strcmp("/carsell", cmdtext, true, 10) == 0)
    {
    if(Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    GivePlayerMoney(playerid, PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPreis]);
    Dtc_Carlock[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]] = 0;
    Dtc_UnLockCar(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]);
    DestroyObject(sirene[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]]);
    sirenean[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]] = false;
    DestroyVehicle(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]);
    new string3[32];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "/Autos/%s%d.dtcar", playername3,Dtc_PlayerKey[playerid]);
    fremove(string3);
    Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]] = 0;
    SendClientMessage(playerid, COLOR_YELLOW, " Fahrzeug erfolgreich verkauft, Hälfte des Kaufpreises wird wurde dir wieder gegeben!");
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du besitzt Kein Fahrzeug!");
    return 1;
    }
    return 1;
    }
    if (strcmp("/park", cmdtext, true, 10) == 0)
    {
    if(Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    new newcar = GetPlayerVehicleID(playerid);
    if (newcar == PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId])
    {
    new Float:X,Float:Y,Float:Z;
    new Float:z_rot;
    GetPlayerPos(playerid, X,Y,Z);
    GetVehicleZAngle(newcar, z_rot);
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_x] = X;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_y] = Y;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_z] = Z;
    PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarRotate] = z_rot;
    SendClientMessage(playerid, COLOR_YELLOW, " Du hast dein Fahrzeug hier geparkt, ab nun kannst du dein Fahrzeug hier finden!");
    }
    else
    {
    SendClientMessage(playerid,COLOR_GREY," Du bist nicht in deinem Fahrzeug/Du hast nicht den Schlüssel zu diesem Fahrzeug ausgewählt!");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du besitzt Kein Fahrzeug für deinen Ausgewählten Schlüssel!");
    return 1;
    }
    return 1;
    }
    if (strcmp("/carlock", cmdtext, true, 10) == 0)
    {
    if(Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    new Status = Dtc_Carlock[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]];
    new Float:dtc_X,Float:dtc_Y,Float:dtc_Z;
    GetVehiclePos(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId],dtc_X,dtc_Y,dtc_Z);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,20.0,dtc_X,dtc_Y,dtc_Z))
    {
    PlayerPlaySound(i,1147,dtc_X,dtc_Y,dtc_Z);
    }
    }
    switch (Status)
    {
    case 0:
    {
    GameTextForPlayer(playerid, "~w~Fahrzeug ~r~abgeschlossen", 5000, 6);
    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
    Dtc_Carlock[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]] = 1;
    Dtc_LockCar(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]);
    }
    case 1:
    {
    GameTextForPlayer(playerid, "~w~Fahrzeug ~g~aufgeschlossen", 5000, 6);
    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
    Dtc_Carlock[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]] = 0;
    Dtc_UnLockCar(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]);
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du besitzt Kein Fahrzeug für deinen Ausgewählten Schlüssel!");
    return 1;
    }
    return 1;
    }
    if (strcmp("/carkey", cmdtext, true, 10) == 0)
    {
    new mv = MaxVeh;
    if(mv > 1)
    {
    Dtc_PlayerKey[playerid] += 1;
    if(Dtc_PlayerKey[playerid] == MaxVeh)
    {
    Dtc_PlayerKey[playerid] = 0;
    }
    if(Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    format(string, sizeof(string), "Du nimmst deinen %dten Auto-Schlüssel, für deinen %s!",Dtc_PlayerKey[playerid]+1,CarName[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarModel]-400]);
    }
    else
    {
    format(string, sizeof(string), "Du nimmst deinen %dten Auto-Schlüssel, doch hast für diesen Schlüssel noch kein Auto!",Dtc_PlayerKey[playerid]+1);
    }
    SendClientMessage(playerid,COLOR_YELLOW,string);
    }
    return 1;
    }


    Schaue mal gleich drüber

  • füg das mal ein :


    if (strcmp("/carlock", cmdtext, true, 10) == 0)
    {
    if(Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
    {
    new Status = Dtc_Carlock[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]];
    new Float:dtc_X,Float:dtc_Y,Float:dtc_Z;
    GetVehiclePos(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId],dtc_X,dtc_Y,dtc_Z);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,20.0,dtc_X,dtc_Y,dtc_Z))
    {
    PlayerPlaySound(i,1147,dtc_X,dtc_Y,dtc_Z);
    }
    }
    switch (Status)
    {
    case 0:
    {
    GameTextForPlayer(playerid, "~w~Fahrzeug ~r~abgeschlossen", 5000, 6);
    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
    Dtc_Carlock[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]] = 1;
    Dtc_LockCar(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]);
    }
    case 1:
    {
    GameTextForPlayer(playerid, "~w~Fahrzeug ~g~aufgeschlossen", 5000, 6);
    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
    Dtc_Carlock[PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]] = 0;
    Dtc_UnLockCar(PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarId]);
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Du besitzt Kein Fahrzeug für deinen Ausgewählten Schlüssel!");
    return 1;
    }
    return 1;