[HILFE] Brauche Hilfe zur Garage

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, ich habe mir ein Garage Interrior gebaut, denn will ich mit ein Teleporter Pickup nutzbar machen. Leider funzt das net so wie ich will.


    Man soll zu fuß und als Fahrer eines Autos "reingeportet" werden. Leider geht das nur zu Fuß, wenn ich im Auto sitz, bleibt das Auto zurück und ich werde geportet.


    Hier das Script:


    #include <a_samp>


    #define FILTERSCRIPT
    new GarageEnter1;
    new GarageEnter2;
    new GarageExit1;
    new GarageExit2;


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print("GarageInterrior by Core2Pacco");
    print("--------------------------------------\n");
    CreateObject(11327,537.92,-1410.67,579.778,0,0,0); //Tor
    CreateObject(13696,548.635,-1411.54,571.028,0,0,0); //Boden
    CreateObject(13696,548.635,-1421.54,581.028,270,0,0); //Wand Rechts
    CreateObject(13696,531.495,-1410.62,581.028,0,90,0); //Wand Vorne
    CreateObject(13696,548.547,-1400.41,581.028,90,0,0); //Wand Links
    CreateObject(13696,561.495,-1410.62,581.028,0,270,0); //Wand Hinten
    CreateObject(13696,548.635,-1411.54,593.928,0,0,0); //Dach
    GarageEnter1 = CreatePickup(1272,1,166.798,-1338.89,69.6203); //Blaues Haus
    GarageEnter2 = CreatePickup(1272,14,166.798,-1338.89,69.6203); //Blaues Haus
    GarageExit1 = CreatePickup(1272,1,538.7868,-1410.8566,578.4260); //Blaues Haus
    GarageExit2 = CreatePickup(1272,14,538.7868,-1410.8566,578.4260); //Blaues Haus
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    if(pickupid == GarageEnter1)
    {
    SetPlayerPos(playerid,542.2825,-1410.8854,578.4260);
    SetPlayerFacingAngle(playerid,270);
    SetCameraBehindPlayer(playerid);
    }
    if(pickupid == GarageEnter2)
    {
    SetPlayerPos(playerid,542.2825,-1410.8854,578.4260);
    SetPlayerFacingAngle(playerid,270);
    SetCameraBehindPlayer(playerid);
    }
    if(pickupid == GarageExit1)
    {
    SetPlayerPos(playerid,168.3734,-1344.4170,69.5407);
    SetPlayerFacingAngle(playerid,180);
    SetCameraBehindPlayer(playerid);
    }
    if(pickupid == GarageExit2)
    {
    SetPlayerPos(playerid,168.3734,-1344.4170,69.5407);
    SetPlayerFacingAngle(playerid,180);
    SetCameraBehindPlayer(playerid);
    }
    return 1;
    }


    Villeicht könnt ihr mir helfen?.

  • public OnPlayerPickUpPickup(playerid, pickupid)
    {
    new State = GetPlayerState(playerid);
    if(pickupid == GarageEnter1)
    {
    if(State == PLAYER_STATE_ONFOOT || PLAYER_STATE_DRIVER)
    {
    SetPlayerPos(playerid,542.2825,-1410.8854,578.4260);
    SetPlayerFacingAngle(playerid,270);
    SetCameraBehindPlayer(playerid);
    }
    }
    if(pickupid == GarageEnter2)
    {
    if(State == PLAYER_STATE_ONFOOT || PLAYER_STATE_DRIVER)
    {
    SetPlayerPos(playerid,542.2825,-1410.8854,578.4260);
    SetPlayerFacingAngle(playerid,270);
    SetCameraBehindPlayer(playerid);
    }
    }
    if(pickupid == GarageExit1)
    {
    if(State == PLAYER_STATE_ONFOOT || PLAYER_STATE_DRIVER)
    {
    SetPlayerPos(playerid,168.3734,-1344.4170,69.5407);
    SetPlayerFacingAngle(playerid,180);
    SetCameraBehindPlayer(playerid);
    }
    }
    if(pickupid == GarageExit2)
    {
    if(State == PLAYER_STATE_ONFOOT || PLAYER_STATE_DRIVER)
    {
    SetPlayerPos(playerid,168.3734,-1344.4170,69.5407);
    SetPlayerFacingAngle(playerid,180);
    SetCameraBehindPlayer(playerid);
    }
    }
    return 1;
    }


    So sollte es meiner Meinung nach funktionieren!

  • @ [FoR]Hardcore Du fragst ja nur ab, dass Leute die zu Fuß oder im Auto sind, geportet werden können ^^ Aber das Auto wird immer noch nicht geportet! Deswegen nützt man SetVehiclePos ^^



    Lösung:


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    if(pickupid == GarageEnter1)
    {
    if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),542.2825,-1410.8854,578.4260);
    else SetPlayerPos(playerid,542.2825,-1410.8854,578.4260);
    SetPlayerFacingAngle(playerid,270);
    SetCameraBehindPlayer(playerid);
    }
    if(pickupid == GarageEnter2)
    {
    if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),542.2825,-1410.8854,578.4260);
    else SetPlayerPos(playerid,542.2825,-1410.8854,578.4260);
    SetPlayerFacingAngle(playerid,270);
    SetCameraBehindPlayer(playerid);
    }
    if(pickupid == GarageExit1)
    {
    if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),542.2825,-1410.8854,578.4260);
    else SetPlayerPos(playerid,168.3734,-1344.4170,69.5407);
    SetPlayerFacingAngle(playerid,180);
    SetCameraBehindPlayer(playerid);
    }
    if(pickupid == GarageExit2)
    {
    if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),542.2825,-1410.8854,578.4260);
    else SetPlayerPos(playerid,168.3734,-1344.4170,69.5407);
    SetPlayerFacingAngle(playerid,180);
    SetCameraBehindPlayer(playerid);
    }
    return 1;
    }

    Mfg Templer


    >>Dein Breadfish-Thema im Unterforum ScriptingBase / Scriptingwünsche wurde nicht richtig beantworter?<<
    >>Es handelt sich um ein Programmier Problem und du nicht einfach weiter kommst wo der Fehler sein könnte?<<
    Dann melde dich bei mir über die PN-Funktion indem du den Link zu deinem Breadfish-Themen Problem schickst.
    Voraussetzung:
    Thema älter als 1 Tag und im Breadfish Forum gespostet!

  • Fast Perfekt mann soll auch das Auto wieder nach unten kriegen

  • Wie nach unten? ^^

    Mfg Templer


    >>Dein Breadfish-Thema im Unterforum ScriptingBase / Scriptingwünsche wurde nicht richtig beantworter?<<
    >>Es handelt sich um ein Programmier Problem und du nicht einfach weiter kommst wo der Fehler sein könnte?<<
    Dann melde dich bei mir über die PN-Funktion indem du den Link zu deinem Breadfish-Themen Problem schickst.
    Voraussetzung:
    Thema älter als 1 Tag und im Breadfish Forum gespostet!

  • Wie nach unten? ^^

    Ja das Auto soll wieder nach unten kommen, egal. Das hier funzt 100%:


    #include <a_samp>
    #include <a_vehicles>


    #define FILTERSCRIPT
    new GarageEnter1;
    new GarageEnter2;
    new GarageExit1;
    new GarageExit2;


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print("GarageInterrior by Core2Pacco");
    print("--------------------------------------\n");
    CreateObject(11327,537.92,-1410.67,579.778,0,0,0); //Tor
    CreateObject(13696,548.635,-1411.54,571.028,0,0,0); //Boden
    CreateObject(13696,548.635,-1421.54,581.028,270,0,0); //Wand Rechts
    CreateObject(13696,531.495,-1410.62,581.028,0,90,0); //Wand Vorne
    CreateObject(13696,548.547,-1400.41,581.028,90,0,0); //Wand Links
    CreateObject(13696,561.495,-1410.62,581.028,0,270,0); //Wand Hinten
    CreateObject(13696,548.635,-1411.54,593.928,0,0,0); //Dach
    GarageEnter1 = CreatePickup(1272,1,166.798,-1338.89,69.6203); //Blaues Haus
    GarageEnter2 = CreatePickup(1272,14,166.798,-1338.89,69.6203); //Blaues Haus
    GarageExit1 = CreatePickup(1272,1,538.7868,-1410.8566,578.4260); //Blaues Haus
    GarageExit2 = CreatePickup(1272,14,538.7868,-1410.8566,578.4260); //Blaues Haus
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    new VehID = GetPlayerVehicleID(playerid);
    if(pickupid == GarageEnter1)
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    SetVehiclePos(VehID,544.2825,-1410.8854,578.4260);
    SetVehicleZAngle(VehID,270);
    }
    else
    {
    SetPlayerPos(playerid,544.2825,-1410.8854,578.4260);
    SetPlayerFacingAngle(playerid,270);
    SetCameraBehindPlayer(playerid);
    }
    }
    if(pickupid == GarageEnter2)
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    SetVehiclePos(VehID,544.2825,-1410.8854,578.4260);
    SetVehicleZAngle(VehID,270);
    }
    else
    {
    SetPlayerPos(playerid,544.2825,-1410.8854,578.4260);
    SetPlayerFacingAngle(playerid,270);
    SetCameraBehindPlayer(playerid);
    }
    }
    if(pickupid == GarageExit1)
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    SetVehiclePos(VehID,168.3734,-1344.4170,69.5407);
    SetVehicleZAngle(VehID,180);
    }
    else
    {
    SetPlayerPos(playerid,168.3734,-1344.4170,69.5407);
    SetPlayerFacingAngle(playerid,180);
    SetCameraBehindPlayer(playerid);
    }
    }
    if(pickupid == GarageExit2)
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    SetVehiclePos(VehID,168.3734,-1344.4170,69.5407);
    SetVehicleZAngle(VehID,180);
    }
    else
    {
    SetPlayerPos(playerid,168.3734,-1344.4170,69.5407);
    SetPlayerFacingAngle(playerid,180);
    SetCameraBehindPlayer(playerid);
    }
    }
    return 1;
    }