[Hilfe]Auto Miet System

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
  • Huhu Community,
    ich habe das gefunden:
    ( Hier bitte klicken, um hinzugelanden ) !
    Ich habe es einwenig verändert und das kam dabei raus:

    #include <a_samp>
    #define COLOR_GREEN 0x00CA00FF
    #define COLOR_RED 0xAA3333AA
    #define FILTERSCRIPT
    new Faggio;
    new BMX;
    new Quad;
    new Oceanic;
    new renttimer;
    new mietauto;
    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Automiet System");
    print("--------------------------------------\n");


    Faggio = AddStaticVehicle(462,1063.3181,-1775.6348,12.9317,270.7531,125,1);
    Faggio = AddStaticVehicle(462,1063.0958,-1772.2661,12.9556,270.1325,125,1);
    Faggio = AddStaticVehicle(462,1063.0006,-1769.7295,12.9655,271.3386,125,1);
    Faggio = AddStaticVehicle(462,1062.8198,-1766.8824,12.9759,268.1136,125,1);
    Faggio = AddStaticVehicle(462,1062.3113,-1763.8118,12.9907,270.3077,125,1);
    Faggio = AddStaticVehicle(462,1062.5679,-1760.3453,13.0048,269.3790,125,1);
    Faggio = AddStaticVehicle(462,1062.2600,-1757.8239,13.0166,270.4363,125,1);
    Faggio = AddStaticVehicle(462,1062.0425,-1754.7965,13.0315,265.4620,125,1);


    BMX=AddStaticVehicle(509,1062.6089,-1751.9164,12.9567,275.1864,3,3);
    BMX=AddStaticVehicle(509,1063.4366,-1749.3182,12.9596,270.4077,3,3);
    BMX=AddStaticVehicle(509,1062.1122,-1749.3273,12.9624,270.3644,3,3);
    BMX=AddStaticVehicle(509,1062.1222,-1745.9658,12.9671,268.7941,3,3);


    Quad = AddStaticVehicle(471,1064.1530,-1737.3223,12.9623,272.7610,3,3);
    Quad = AddStaticVehicle(471,1064.5862,-1740.0004,12.9561,269.2890,3,3);
    Quad = AddStaticVehicle(471,1064.6094,-1743.2980,12.9459,271.5169,3,3);


    Oceanic = AddStaticVehicle(467,1077.8439,-1775.4065,13.0849,88.6153,3,3);
    Oceanic = AddStaticVehicle(467,1077.7587,-1772.7949,13.0906,90.2625,3,3);
    Oceanic = AddStaticVehicle(467,1077.5604,-1769.6217,13.0973,90.0995,3,3);
    Oceanic = AddStaticVehicle(467,1077.5466,-1766.7721,13.1045,88.8401,3,3);
    Oceanic = AddStaticVehicle(467,1077.3843,-1763.5603,13.1530,90.6120,3,3);


    return 1;
    }


    public OnFilterScriptExit()
    {
    DestroyVehicle(Faggio);
    DestroyVehicle(BMX);
    DestroyVehicle(Quad);
    DestroyVehicle(Oceanic);


    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/rentcar", cmdtext, true, 0) == 0)
    {
    new Vehicle = GetPlayerVehicleID(playerid);
    if(Vehicle == Faggio){
    GivePlayerMoney(playerid,-100);
    TogglePlayerControllable(playerid, 1);
    mietauto = Vehicle;
    renttimer = SetTimer("rentcar",15000,false);
    SendClientMessage(playerid,COLOR_GREEN,"Du hast ein Roller gemietet.");


    if(Vehicle == BMX){
    GivePlayerMoney(playerid,-50);
    TogglePlayerControllable(playerid, 1);
    mietauto = Vehicle;
    renttimer = SetTimer("rentcar",15000,false);
    SendClientMessage(playerid,COLOR_GREEN,"Du hast ein BMX gemietet.");


    if(Vehicle == Quad){
    GivePlayerMoney(playerid,-4000);
    TogglePlayerControllable(playerid, 1);
    mietauto = Vehicle;
    renttimer = SetTimer("rentcar",15000,false);
    SendClientMessage(playerid,COLOR_GREEN,"Du hast ein Quad gemietet.");


    if(Vehicle == Oceanic){
    GivePlayerMoney(playerid,-2500);
    TogglePlayerControllable(playerid, 1);
    mietauto = Vehicle;
    renttimer = SetTimer("rentcar",15000,false);
    SendClientMessage(playerid,COLOR_GREEN,"Du hast ein Oceanic gemietet.");




    }else{
    SendClientMessage(playerid,COLOR_GREEN,"Du bist in keinem Mietauto");
    }
    return 1;
    }


    return 0;
    }
    public rentcar(playerid)
    {
    if(IsPlayerInAnyVehicle(playerid) == true)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_RED,"Deine Mietzeit ist vorbei.");
    SetVehicleToRespawn(mietauto);
    KillTimer(renttimer);
    SetTimerEx("rentcar",15000,0,"i",playerid);
    }
    return 0;
    }


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(newstate == PLAYER_STATE_DRIVER)
    {
    new mieten[20];
    new Vehicle = GetPlayerVehicleID(playerid);
    if(Vehicle == Faggio || Vehicle == BMX || Vehicle == Quad || Vehicle == Oceanic){
    TogglePlayerControllable(playerid, 0);
    SendClientMessage(playerid,COLOR_GREEN,"Du kannst dieses Auto mit /rentcar mieten.");
    }
    }
    return 1;
    }


    public OnPlayerExitVehicle(playerid, vehicleid)
    {
    return 1;
    }
    Nun kommen aber folgende Fehler:
    C:\Users\Souzu\Desktop\RentSystem.pwn(66) : warning 217: loose indentation
    C:\Users\Souzu\Desktop\RentSystem.pwn(73) : warning 217: loose indentation
    C:\Users\Souzu\Desktop\RentSystem.pwn(80) : warning 217: loose indentation
    C:\Users\Souzu\Desktop\RentSystem.pwn(95) : warning 217: loose indentation
    C:\Users\Souzu\Desktop\RentSystem.pwn(97) : warning 217: loose indentation
    C:\Users\Souzu\Desktop\RentSystem.pwn(97) : error 029: invalid expression, assumed zero
    C:\Users\Souzu\Desktop\RentSystem.pwn(97) : error 017: undefined symbol "rentcar"
    C:\Users\Souzu\Desktop\RentSystem.pwn(99) : warning 213: tag mismatch
    C:\Users\Souzu\Desktop\RentSystem.pwn(110) : warning 225: unreachable code
    C:\Users\Souzu\Desktop\RentSystem.pwn(110) : error 029: invalid expression, assumed zero
    C:\Users\Souzu\Desktop\RentSystem.pwn(110) : error 004: function "OnPlayerStateChange" is not implemented
    C:\Users\Souzu\Desktop\RentSystem.pwn(112) : error 017: undefined symbol "newstate"
    C:\Users\Souzu\Desktop\RentSystem.pwn(115) : warning 219: local variable "Vehicle" shadows a variable at a preceding level
    C:\Users\Souzu\Desktop\RentSystem.pwn(114) : warning 204: symbol is assigned a value that is never used: "mieten"
    C:\Users\Souzu\Desktop\RentSystem.pwn(124) : warning 225: unreachable code
    C:\Users\Souzu\Desktop\RentSystem.pwn(124) : error 029: invalid expression, assumed zero
    C:\Users\Souzu\Desktop\RentSystem.pwn(124) : error 004: function "OnPlayerExitVehicle" is not implemented
    C:\Users\Souzu\Desktop\RentSystem.pwn(128) : error 030: compound statement not closed at the end of file (started at line 60)


    Es waren voher mehr Fehler, einige konnte ich aber selbst beheben!
    Bei denen komme ich nun aber nicht mehr weiter!
    Könnte mir vllt. jemand helfen?
    Wäre darüber sehr dankbar :3.


    Gruß Souzu