Fahrzeugremove

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 zusammen.. ich weiß nicht mehr weiter.. ich kann nicht mehr mit einem Fahrzeug fahren, denn werde immer wieder rausgeworfen!
    Ich bekomme keine Meldung dass ich dazu nicht berechtigt bin und habe mir auch schon den Führerschein neu gegeben..
    weiß jemand vll weiter?


    MfG


    Destiny - RealLife is coming SOON!
    Wir sind zurück besser als je zuvor! :*

  • public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    new string[256];
    if(newstate == PLAYER_STATE_ONFOOT)
    {
    if(PlayerKarting[playerid] > 0 && PlayerInKart[playerid] > 0)
    {
    PlayerInKart[playerid] = 0;
    KartingPlayers --;
    }
    if(TransportDuty[playerid] > 0)
    {
    if(TransportDuty[playerid] == 1)
    {
    TaxiDrivers -= 1;
    }
    else if(TransportDuty[playerid] == 2)
    {
    BusDrivers -= 1;
    }
    TransportDuty[playerid] = 0;
    format(string, sizeof(string), "* You are now Off Duty and earned $%d.", TransportMoney[playerid]);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    GivePlayerMoney(playerid, TransportMoney[playerid]);
    ConsumingMoney[playerid] = 1; TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
    }
    if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
    {
    if(IsPlayerConnected(TransportDriver[playerid]))
    {
    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
    TransportTime[TransportDriver[playerid]] = 0;
    TransportCost[TransportDriver[playerid]] = 0;
    format(string, sizeof(string), "~w~The ride cost~n~~r~$%d",TransportCost[playerid]);
    GameTextForPlayer(playerid, string, 5000, 1);
    format(string, sizeof(string), "~w~Passenger left the taxi~n~~g~Earned $%d",TransportCost[playerid]);
    GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
    GivePlayerMoney(playerid, -TransportCost[playerid]);
    TransportCost[playerid] = 0;
    TransportTime[playerid] = 0;
    TransportDriver[playerid] = 999;
    }
    }
    TelePos[playerid][0] = 0.0;
    TelePos[playerid][1] = 0.0;
    }
    if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new vehicleid = GetPlayerVehicleID(playerid);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
    {
    if(GetPlayerMoney(playerid) < TransportValue[i])
    {
    format(string, sizeof(string), "* You need $%d to enter.", TransportValue[i]);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    RemovePlayerFromVehicle(playerid);
    }
    else
    {
    if(TransportDuty[i] == 1)
    {
    format(string, sizeof(string), "* You paid $%d to the Taxi Driver.", TransportValue[i]);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "* Passenger %s has entered your Taxi.", name);
    SendClientMessage(i, COLOR_LIGHTBLUE, string);
    TransportTime[i] = 1;
    TransportTime[playerid] = 1;
    TransportCost[playerid] = TransportValue[i];
    TransportCost[i] = TransportValue[i];
    TransportDriver[playerid] = i;
    }
    else if(TransportDuty[i] == 2)
    {
    format(string, sizeof(string), "* You paid $%d to the Bus Driver.", TransportValue[i]);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "* Passenger %s has entered your Bus.", name);
    SendClientMessage(i, COLOR_LIGHTBLUE, string);
    }
    GivePlayerMoney(playerid, - TransportValue[i]);
    TransportMoney[i] += TransportValue[i];
    }
    }
    }
    }
    }
    if(newstate == PLAYER_STATE_WASTED)
    {
    if(WantedLevel[playerid] >= 1)
    {
    new price = WantedLevel[playerid] * 4000;
    new count;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(gTeam[i] == 2 && CrimInRange(30.0, playerid,i))
    {
    count = 1;
    format(string, sizeof(string), "~w~Running Suspect~r~Killed~n~Bonus~g~$%d", price);
    GameTextForPlayer(i, string, 5000, 1);
    ConsumingMoney[i] = 1;
    GivePlayerMoney(i, price / 2);
    PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
    }
    }
    }
    if(count == 1)
    {
    GivePlayerMoney(playerid, - price);
    PlayerInfo[playerid][pWantedDeaths] += 1;
    PlayerInfo[playerid][pJailed] = 1;
    PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid])*(600);
    format(string, sizeof(string), "* You are in Jail for %d Seconds and lose $%d because of running away and getting shot by the Officer.", PlayerInfo[playerid][pJailTime], price);
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    WantedPoints[playerid] = 0;
    WantedLevel[playerid] = 0;
    }
    }
    }
    if(newstate == PLAYER_STATE_DRIVER) //buggy dont finnish
    {// 38 / 49 / 56 = SS
    new newcar = GetPlayerVehicleID(playerid);
    new oldcar = gLastCar[playerid];
    new housecar = PlayerInfo[playerid][pPhousekey]+1;
    TelePos[playerid][0] = 0.0;
    TelePos[playerid][1] = 0.0;
    if(IsABoat(newcar))
    {
    if(PlayerInfo[playerid][pBoatLic] < 1)
    {
    SendClientMessage(playerid, COLOR_GREY, " You don't know how to Sail yet, so you left the Boat !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    else if(IsAPlane(newcar))
    {
    if(PlayerInfo[playerid][pFlyLic] < 1)
    {
    if(TakingLesson[playerid] == 1) { }
    else {
    SendClientMessage(playerid, COLOR_GREY, " You don't know how to Fly yet, so you left the Plane !");
    RemovePlayerFromVehicle(playerid); }
    }
    }
    else
    {
    if(PlayerInfo[playerid][pCarLic] < 1)
    {
    if(PlayerDrunk[playerid] >= 5)
    {
    WantedPoints[playerid] += 1;
    SetPlayerCriminal(playerid,255, "Drunk Driving");
    }
    if(TakingLesson[playerid] == 1) { }
    else {
    SendClientMessage(playerid, COLOR_GREY, " You don't know how to Drive yet, so you left the Car !");
    RemovePlayerFromVehicle(playerid); }
    }
    else if(PlayerDrunk[playerid] >= 5)
    {
    WantedPoints[playerid] += 1;
    SetPlayerCriminal(playerid,255, "Drunk Driving");
    }
    }//Done with car check
    if(IsACopCar(newcar))
    {
    if(IsACop(playerid)) { }
    else { RemovePlayerFromVehicle(playerid); }
    }
    else if(IsAnAmbulance(newcar))
    {
    if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4) { }
    else { RemovePlayerFromVehicle(playerid); }
    }
    if(IsATruck(newcar))
    {
    format(string, sizeof(string), "Products: %d/%d", PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    SendClientMessage(playerid, COLOR_WHITE, "INFO: You can deliver Products to Businesses.");
    SendClientMessage(playerid, COLOR_WHITE, "INFO: Commands are /load /buyprods /sellprods");
    }
    if(PlayerKarting[playerid] != 0)
    {
    new kart = GetPlayerVehicleID(playerid);
    if(kart==333||kart==334||kart==335||kart==336||kart==338||kart==339)
    {
    PlayerInKart[playerid] = 1;
    KartingPlayers ++;
    }
    }
    if(newcar == 342 || newcar == 341)
    {
    if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)//national guard
    {
    if(PlayerInfo[playerid][pRank] < 3)
    {
    SendClientMessage(playerid,COLOR_GREY," You need Rank 3 to Fly this baby !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    }
    }
    if(newcar == 343 || newcar == 344)
    {
    if(PlayerInfo[playerid][pMember] != 4)
    {
    SendClientMessage(playerid,COLOR_GREY," You are not a Fireman !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    if(newcar == 345 || newcar == 346)
    {
    if(PlayerInfo[playerid][pJob] != 14)
    {
    SendClientMessage(playerid,COLOR_GREY," You are not a Bus Driver !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    else if(IsALvpdCar(newcar))
    {
    if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1) { }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GREY, "Du bist kein Beamter!");
    }
    }
    if(IsAArmyCar(newcar))
    {
    if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) { }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GREY, "Du bist kein Beamter!");
    }
    }
    if(IsAOamtCar(newcar))
    {
    if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) { }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_GREY,"Du bist nicht vom Ordnungsamt!");
    }
    }
    if(IsAFfwCar(newcar))
    {
    if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4) { }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_GREY,"Du bist keiner von der Feuerwehr!");
    }
    }
    if(IsAMedicCar(newcar))
    {
    if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4) { }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_GREY,"Du bist keiner von den Sanitätern!");
    }
    }
    if(IsAGangsterCar(newcar))
    {
    if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5) { }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_GREY,"Du bist nicht bei den Fort Carson Gangsters!");
    }
    }
    if(IsABandosCar(newcar))
    {
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_GREY,"Du bist nicht bei den Los Bandos Bikern!");
    }
    }
    if(newcar == 960)
    {
    if(TakingLesson[playerid] == 1) { }
    else if(!IsAnInstructor(playerid))
    {
    SendClientMessage(playerid,COLOR_GREY," You are not a School Instructor !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    if(newcar == 956 || newcar == 954 || newcar == 958 || newcar == 959)
    {
    if(PlayerInfo[playerid][pMember] == 10||PlayerInfo[playerid][pLeader] == 10) { }
    else
    {
    SendClientMessage(playerid,COLOR_GREY," You are not a Taxi Driver !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    if(newcar == 666)
    {
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
    {
    if(PlayerInfo[playerid][pRank] < 3)
    {
    SendClientMessage(playerid, COLOR_GREY, " Your Rank is to Low !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " You are not a Hitman !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    if(newcar == 888 || newcar == 887 || newcar == 886)
    {
    if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9){ }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " You are not a News Reporter !");
    RemovePlayerFromVehicle(playerid);
    }
    if(PlayerInfo[playerid][pNewsSkill] < 200 && newcar == 434)
    {
    SendClientMessage(playerid, COLOR_GREY, " Your News Reporter Skill is to low, cant fly the Chopper yet !");
    RemovePlayerFromVehicle(playerid);
    }
    }
    if(newcar==543)
    {
    if(PlayerKarting[playerid] != 1)
    {
    RemovePlayerFromVehicle(playerid);
    }
    }
    if(newcar >= 555 && newcar <= 556)
    {
    if (HireCar[playerid] != newcar)
    {
    format(string, sizeof(string), "~w~You can Rent this car~n~Cost:~g~$%d~n~~w~To rent type ~g~/rentcar~w~~n~to get out type ~r~/exit",SBizzInfo[0][sbEntranceCost]);
    TogglePlayerControllable(playerid, 0);
    GameTextForPlayer(playerid, string, 5000, 3);
    }
    }
    if(newcar >= 367 && newcar <= 368)
    {
    if (HireCar[playerid] != newcar)
    {
    format(string, sizeof(string), "~w~You can Rent this car~n~Cost:~g~$%d~n~~w~To rent type ~g~/rentcar~w~~n~to get out type ~r~/exit",SBizzInfo[1][sbEntranceCost]);
    TogglePlayerControllable(playerid, 0);
    GameTextForPlayer(playerid, string, 5000, 3);
    }
    }
    if(oldcar != 301)
    {
    if((housecar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != housecar))
    {
    if(gLastDriver[oldcar] == playerid && oldcar != newcar)
    {
    gLastDriver[oldcar] = 300;
    gCarLock[oldcar] = 0;
    UnLockCar(oldcar);
    }
    }
    }
    gLastCar[playerid] = newcar;
    gLastDriver[newcar] = playerid;
    }
    if(newstate == PLAYER_STATE_SPAWNED)
    {
    new Float: lwx, Float:lwy, Float:lwz;
    GetPlayerPos(playerid, lwx, lwy, lwz);
    if((lwz > 530.0 && PlayerInfo[playerid][pInt] == 0) || PlayerToPoint(1000.0, playerid, -1041.9,-1868.4,79.1)) //the highest land point in sa = 526.8
    {
    SetPlayerSpawn(playerid);
    }
    if(WantedPoints[playerid] > 0)
    {
    new dstring[128];
    new wanted = WantedPoints[playerid];
    new diecash = 0;
    while(WantedPoints[playerid] > 0)
    {
    diecash += 500;
    WantedPoints[playerid] --;
    }
    format(dstring, sizeof(dstring), "You lost $%d for dieing with %d Wanted Points.", diecash, wanted);
    SendClientMessage(playerid, COLOR_YELLOW, dstring);
    GivePlayerMoney(playerid, - diecash);
    PlayerInfo[playerid][pWantedDeaths] += 1;
    }
    if(PlayerOnMission[playerid] > 0)
    {
    GameTextForPlayer(playerid, "~r~Mission failed", 5000, 3);
    PlayerOnMission[playerid] = 0;
    PlayerInfo[playerid][pMissionNr] = 0;
    }
    WantedPoints[playerid] = 0;
    WantedLevel[playerid] = 0;
    if(PlayerInfo[playerid][pDonateRank] > 0) { SetPlayerHealth(playerid, 100.0); }
    else { SetPlayerHealth(playerid, 50.0+PlayerInfo[playerid][pSHealth]); }
    MedicBill[playerid] = 1;
    TelePos[playerid][0] = 0.0;
    TelePos[playerid][1] = 0.0;
    gPlayerSpawned[playerid] = 1;
    SafeTime[playerid] = 60;
    }
    return 1;
    }



    Achtung!: Ich kann wieder fahren, aber bei meinen Bot geht es nicht.. vorher gings aber auch noch ( vor paar tagen )


    MfG


    Destiny - RealLife is coming SOON!
    Wir sind zurück besser als je zuvor! :*