Autospawnener => Autohaus

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 Community,
    Ich habe einen Autospawnen bzw. Flugzeug Spawner gebastelt.
    Jetzt will ich es so machen das wenn man einen mit /Autospawnen kauft Geld abgezogen wird.


    Ich will es aber so machen das bei allen verschieden der Preis ist....


    Und daraus will ich kein Dialog mehr machen sondern ein Pickup :D :whistling: :wacko:


    Edit/:
    Text überarbeitet

    Einmal editiert, zuletzt von G0TT ()

  • #include <a_samp>
    #define Dialog 4670


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print("Flugzeugautohaus");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    print("\n----------------------------------");
    print("Flugzeugautohaus");
    print("----------------------------------\n");
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (!strcmp(cmdtext, "/Autospawnen", true))
    {
    ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_LIST, "Auto Dialog", "Beagle\nCropduster\nDodo\nRustler\nSkimmer\nStuntplane\nMaverick\nSeasparrow\nSparrow", "Spawn", "Abbrechen");
    return 1;
    }
    return 0;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == Dialog)
    {
    switch(listitem)
    {
    case 0:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    GetPlayerInterior(playerid);
    pVeh = CreateVehicle(511, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    }
    case 1:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(512, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    }
    case 2:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(593, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    }
    case 3:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(476, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    }
    case 4:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(460, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    }
    case 5:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(513, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    }
    case 6:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(487, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    }
    case 7:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(447, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    }
    case 8:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(469, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);


    }
    }
    }
    return 1;
    }


    Für jedes Fahrzeug ein anderer Preis und das es als Pickup ist :wacko:
    Das mit dem Geld hab ich jetz geklärt aber was ist wenn man kein Geld dafür hat da brauch ich nen Error :D :evil:

  • Du erstellst einen Pickup .
    Wie das geht weisste ja bestimmt .


    Unter onplayerpickup....( ka Wiedes genau heißt )
    If(Pickupid == wiedudeinpickupnennst)
    {
    ShowPlayerDialog( blablabla)
    }


    Mit dem Geld poste ich gleich. Kb über iPhone zu schreiben...


    Meinst du es so? Oder hab ich es immernoch nicht begriffen ? xD

    Projektleiter

    Cleared to Land ist in der Script Werkstatt ;)


  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • du machst:


    new autopickup;


    public OnGameModeInit()
    {
    autopickup = AddStaticPickup(picupid,1,x,y,z,);
    }


    public OnPlayerPickupPickup
    {
    if(pickupid == autopickup)
    {
    ShowPlayerDialog(dein dialog zeugs)
    }
    }

  • #include <a_samp>
    #define Dialog 4670


    new carpickup;


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print("Flugzeugautohaus");
    print("--------------------------------------\n");
    carpickup = AddStaticPickup(picupid,1,x,y,z,-1);
    return 1;
    }


    public OnFilterScriptExit()
    {
    print("\n----------------------------------");
    print("Flugzeugautohaus");
    print("----------------------------------\n");
    return 1;
    }



    public OnPlayerPickUpPickup(...)
    {
    if(pickupid==carpickup)
    {
    ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_LIST, "Auto Dialog", "Beagle\nCropduster\nDodo\nRustler\nSkimmer\nStuntplane\nMaverick\nSeasparrow\nSparrow", "Spawn", "Abbrechen");
    }
    return 1;
    }





    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == Dialog)
    {
    switch(listitem)
    {
    case 0:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    GetPlayerInterior(playerid);
    pVeh = CreateVehicle(511, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 1:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(512, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 2:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(593, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 3:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(476, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 4:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(460, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 5:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(513, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 6:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(487, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 7:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(447, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 8:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(469, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    }
    }
    return 1;
    }



    Maddin is my Lord and Master :D
    Musel my one and only b0wm
    Bisafloah is the pokemon that pwns a lot of goddamn ponys.

  • Zeile (11) : Unbekannte Variable : "picupid"
    Zeile (24) : error 025: function heading differs from prototype
    Zeile (26) : Unbekannte Variable : "pickupid"
    Zeile (28) : Unbekannte Variable : "playerid"

  • Zeile (11) : Unbekannte Variable : "pickupid"
    Zeile (24) : error 025: function heading differs from prototype
    Zeile (26) : Unbekannte Variable : "pickupid"
    Zeile (28) : Unbekannte Variable : "playerid"



    Hmmm :D

  • Achso, ich dachte die Zeilen stimmen net überrein mit dem Code oben.. ist ja n Filterscript^^


    Edit:


    #include <a_samp>
    #define Dialog 4670


    new carpickup;


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print("Flugzeugautohaus");
    print("--------------------------------------\n");
    carpickup = AddStaticPickup(pickupid,1,x,y,z,-1);
    return 1;
    }


    public OnFilterScriptExit()
    {
    print("\n----------------------------------");
    print("Flugzeugautohaus");
    print("----------------------------------\n");
    return 1;
    }



    public OnPlayerPickUpPickup(...)
    {
    if(pickupid==carpickup)
    {
    ShowPlayerDialog(playerid, Dialog, DIALOG_STYLE_LIST, "Auto Dialog", "Beagle\nCropduster\nDodo\nRustler\nSkimmer\nStuntplane\nMaverick\nSeasparrow\nSparrow", "Spawn", "Abbrechen");
    }
    return 1;
    }





    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == Dialog)
    {
    switch(listitem)
    {
    case 0:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    GetPlayerInterior(playerid);
    pVeh = CreateVehicle(511, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 1:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(512, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 2:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(593, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 3:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(476, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 4:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(460, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 5:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(513, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 6:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(487, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 7:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(447, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    case 8:
    {
    new Float:X, Float:Y, Float:Z, Float:Ang, Int, pVeh;
    Int = GetPlayerInterior(playerid);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, Ang);
    pVeh = CreateVehicle(469, X, Y, Z, Ang, 0, 0, -1);
    LinkVehicleToInterior(pVeh, Int);
    PutPlayerInVehicle(playerid, pVeh, 0);
    GivePlayerMoney(playerid,-2000);
    }
    }
    }
    return 1;
    }



    ist das jetz so bei dir? Compile ma mit dem xD
    Freundliche Grüsse
    Vince

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen