Hilfe für Zoll-Script

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 Leute,
    Habe mich an einem Zollscript versucht.
    Jedoch funktionieren nur zoll1, zoll2, zoll3 aber zoll 4 nicht (zoll1 und 2 waren schon im Code)
    Das andere Problem ist, wenn ich /toll eingebe werden mir 2500$ abgezogen obwohl
    keine Station in der Nähe ist. Und wie oben schon erwähtn ,öffnet sich zoll 4 gar nicht aber
    auch hier wird mir Geld abgezogen



    Hier mal der Code:


    #include <a_samp>
    #define COLOR_RED 0xAA3333AA
    #define FILTERSCRIPT
    #if defined FILTERSCRIPT
    #pragma tabsize 0
    forward GateCloseZoll1();
    forward GateCloseZoll2();
    forward GateCloseZoll3();
    forward GateCloseZoll4();
    new zoll1;
    new zoll2;
    new zoll3;
    new zoll4;


    public OnFilterScriptInit()
    {
    CreateObject(8168, 62.639053, -1533.241577, 6.127338, 0.0000, 0.0000, 186.8756);
    CreateObject(8168, 49.255692, -1531.192993, 6.260714, 0.0000, 0.0000, 6.9528);
    CreateObject(994, 52.837242, -1531.628052, 4.381447, 0.0000, 0.0000, 348.8273);
    CreateObject(996, 27.192585, -1539.311401, 4.490602, 0.0000, 0.0000, 339.2189);
    CreateObject(996, 25.940092, -1516.013306, 4.384654, 0.0000, 356.5623, 353.9067);
    CreateObject(966, 52.582298, -1534.520874, 4.111042, 0.0000, 0.0000, 80.4688);
    CreateObject(966, 59.172279, -1529.614868, 3.997721, 0.0000, 0.0000, 261.3284);
    CreateObject(996, 52.591675, -1521.283569, 4.823681, 0.0000, 0.0000, 348.7500);
    CreateObject(996, 43.648811, -1541.607788, 4.955574, 0.0000, 0.0000, 2.5783);
    CreateObject(996, 52.307480, -1541.463867, 4.908387, 0.0000, 0.0000, 345.3122);
    CreateObject(996, 61.247620, -1522.886963, 4.766047, 0.0000, 0.0000, 358.2811);
    AddStaticVehicleEx(598,1726.52087402,439.37991333,30.80324173,343.25000000,-1,-1,15); //Police Car (LVPD)
    AddStaticVehicleEx(596,1694.75292969,450.92028809,30.72408295,159.25000000,-1,1,15); //Police Car (LSPD)
    CreateObject(967,1712.14062500,442.45053101,29.93284988,0.00000000,0.00000000,254.00000000); //object(bar_gatebox01) (1)
    CreateObject(966,1705.81542969,444.02944946,29.92721176,0.00000000,0.00000000,341.99993896); //object(bar_gatebar01) (1)
    CreateObject(994,1722.14672852,436.74719238,29.99340248,0.00000000,0.00000000,339.74987793); //object(lhouse_barrier2) (1)
    CreateObject(996,1722.46423340,437.43814087,30.68734550,0.00000000,0.00000000,70.25000000); //object(lhouse_barrier1) (1)
    CreateObject(997,1712.09057617,441.45587158,29.95201302,0.00000000,0.00000000,342.00000000); //object(lhouse_barrier3) (1)
    CreateObject(996,1715.32617188,441.18475342,30.74855614,0.00000000,0.00000000,70.25000000); //object(lhouse_barrier1) (4)
    CreateObject(967,1708.83532715,443.60412598,29.93284988,0.00000000,0.00000000,71.99841309); //object(bar_gatebox01) (2)
    CreateObject(997,1706.20715332,443.38531494,29.95201302,0.00000000,0.00000000,341.99890137); //object(lhouse_barrier3) (3)
    CreateObject(996,1706.49096680,444.08734131,30.74855614,0.00000000,0.00000000,71.24670410); //object(lhouse_barrier1) (5)
    CreateObject(966,1716.04919434,440.88635254,29.92721176,0.00000000,0.00000000,160.49877930); //object(bar_gatebar01) (3)
    CreateObject(994,1695.07189941,455.16018677,29.99340248,0.00000000,0.00000000,340.49670410); //object(lhouse_barrier2) (6)
    CreateObject(996,1698.58618164,446.04281616,30.68734550,0.00000000,0.00000000,70.24658203); //object(lhouse_barrier1) (6)
    CreateObject(1237,1694.45751953,455.29602051,29.99455261,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (1)
    zoll1 = CreateObject(968, 51.417946, -1541.257446, 4.870291, 0.0000, 269.7591, 260.3054);
    zoll2 = CreateObject(968, 60.200123, -1522.848999, 4.740675, 0.0000, 89.3814, 261.4057);
    zoll3 = CreateObject(968,1716.05603027,440.96206665,30.82939339,0.00000000,90.75018311,339.99987793); //object(barrierturn) (1)
    zoll4 = CreateObject(968,1705.84082031,444.04003906,30.73889160,0.00000000,269.00000000,341.99890137); //object(barrierturn) (4)
    return 1;
    }
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp(cmdtext, "/toll", true) == 0)
    {
    if (IsPlayerInRangeOfPoint(playerid,7.0, 48.7261,-1537.2622,5.0223))
    {
    SetObjectRot(zoll1, 0.0000, 359.1406, 260.3054);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll1", 3500, 0);
    }
    else if (IsPlayerInRangeOfPoint(playerid, 7.0, 62.9513,-1526.6962,4.7878))
    {
    SetObjectRot(zoll2, 0.0000, 0.0000, 261.4057);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll2", 3500, 0);
    }
    else if (IsPlayerInRangeOfPoint(playerid,7.0, 1716.99, 434.407, 30.7169))
    {
    SetObjectRot(zoll3, 0.0000, 0.99993896484375, 339.99987792969);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll3", 3500, 0);
    }
    else if (IsPlayerInRangeOfPoint(playerid,7.0, 1704.59, 450.542, 30.5653))
    {
    SetObjectRot(zoll4, 0.00000000, 269.00000000, 341.99890137);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll4", 3500, 0);
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED,"You aren't at any toll station");
    return 1;
    }
    return 1;
    }
    return 0;
    }
    public GateCloseZoll1()
    {
    SetObjectRot(zoll1, 0.0000, 269.7591, 260.3054);
    return 1;
    }
    public GateCloseZoll2()
    {
    SetObjectRot(zoll2, 0.0000, 89.3814, 261.4057);
    return 1;
    }
    public GateCloseZoll3()
    {
    SetObjectRot(zoll3, 0.00000000, 90.75018311, 339.99987793);
    return 1;
    }
    public GateCloseZoll4()
    {
    SetObjectRot(zoll4, 0.00000000, 269.00000000, 341.99890137);
    return 1;
    }
    #endif

    Einmal editiert, zuletzt von Zcelo12 ()

  • Das 4. Gate hat die gleichen Koordinaten wie das 3. ?

  • #include <a_samp>
    #define COLOR_RED 0xAA3333AA
    #define FILTERSCRIPT
    #if defined FILTERSCRIPT
    #pragma tabsize 0
    forward GateCloseZoll1();
    forward GateCloseZoll2();
    forward GateCloseZoll3();
    forward GateCloseZoll4();
    new zoll1;
    new zoll2;
    new zoll3;
    new zoll4;


    public OnFilterScriptInit()
    {
    CreateObject(8168, 62.639053, -1533.241577, 6.127338, 0.0000, 0.0000, 186.8756);
    CreateObject(8168, 49.255692, -1531.192993, 6.260714, 0.0000, 0.0000, 6.9528);
    CreateObject(994, 52.837242, -1531.628052, 4.381447, 0.0000, 0.0000, 348.8273);
    CreateObject(996, 27.192585, -1539.311401, 4.490602, 0.0000, 0.0000, 339.2189);
    CreateObject(996, 25.940092, -1516.013306, 4.384654, 0.0000, 356.5623, 353.9067);
    CreateObject(966, 52.582298, -1534.520874, 4.111042, 0.0000, 0.0000, 80.4688);
    CreateObject(966, 59.172279, -1529.614868, 3.997721, 0.0000, 0.0000, 261.3284);
    CreateObject(996, 52.591675, -1521.283569, 4.823681, 0.0000, 0.0000, 348.7500);
    CreateObject(996, 43.648811, -1541.607788, 4.955574, 0.0000, 0.0000, 2.5783);
    CreateObject(996, 52.307480, -1541.463867, 4.908387, 0.0000, 0.0000, 345.3122);
    CreateObject(996, 61.247620, -1522.886963, 4.766047, 0.0000, 0.0000, 358.2811);
    AddStaticVehicleEx(598,1726.52087402,439.37991333,30.80324173,343.25000000,-1,-1,15); //Police Car (LVPD)
    AddStaticVehicleEx(596,1694.75292969,450.92028809,30.72408295,159.25000000,-1,1,15); //Police Car (LSPD)
    CreateObject(967,1712.14062500,442.45053101,29.93284988,0.00000000,0.00000000,254.00000000); //object(bar_gatebox01) (1)
    CreateObject(966,1705.81542969,444.02944946,29.92721176,0.00000000,0.00000000,341.99993896); //object(bar_gatebar01) (1)
    CreateObject(994,1722.14672852,436.74719238,29.99340248,0.00000000,0.00000000,339.74987793); //object(lhouse_barrier2) (1)
    CreateObject(996,1722.46423340,437.43814087,30.68734550,0.00000000,0.00000000,70.25000000); //object(lhouse_barrier1) (1)
    CreateObject(997,1712.09057617,441.45587158,29.95201302,0.00000000,0.00000000,342.00000000); //object(lhouse_barrier3) (1)
    CreateObject(996,1715.32617188,441.18475342,30.74855614,0.00000000,0.00000000,70.25000000); //object(lhouse_barrier1) (4)
    CreateObject(967,1708.83532715,443.60412598,29.93284988,0.00000000,0.00000000,71.99841309); //object(bar_gatebox01) (2)
    CreateObject(997,1706.20715332,443.38531494,29.95201302,0.00000000,0.00000000,341.99890137); //object(lhouse_barrier3) (3)
    CreateObject(996,1706.49096680,444.08734131,30.74855614,0.00000000,0.00000000,71.24670410); //object(lhouse_barrier1) (5)
    CreateObject(966,1716.04919434,440.88635254,29.92721176,0.00000000,0.00000000,160.49877930); //object(bar_gatebar01) (3)
    CreateObject(994,1695.07189941,455.16018677,29.99340248,0.00000000,0.00000000,340.49670410); //object(lhouse_barrier2) (6)
    CreateObject(996,1698.58618164,446.04281616,30.68734550,0.00000000,0.00000000,70.24658203); //object(lhouse_barrier1) (6)
    CreateObject(1237,1694.45751953,455.29602051,29.99455261,0.00000000,0.00000000,0.00000000); //object(strtbarrier01) (1)
    zoll1 = CreateObject(968, 51.417946, -1541.257446, 4.870291, 0.0000, 269.7591, 260.3054);
    zoll2 = CreateObject(968, 60.200123, -1522.848999, 4.740675, 0.0000, 89.3814, 261.4057);
    zoll3 = CreateObject(968,1716.05603027,440.96206665,30.82939339,0.00000000,90.75018311,339.99987793); //object(barrierturn) (1)
    zoll4 = CreateObject(968,1705.84082031,444.04003906,30.73889160,0.00000000,269.00000000,341.99890137); //object(barrierturn) (4)
    return 1;
    }
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp(cmdtext, "/toll", true) == 0)
    {
    if (IsPlayerInRangeOfPoint(playerid,7.0, 48.7261,-1537.2622,5.0223))
    {
    SetObjectRot(zoll1, 0.0000, 359.1406, 260.3054);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll1", 3500, 0);
    }
    else if (IsPlayerInRangeOfPoint(playerid, 7.0, 62.9513,-1526.6962,4.7878))
    {
    SetObjectRot(zoll2, 0.0000, 0.0000, 261.4057);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll2", 3500, 0);
    }
    else if (IsPlayerInRangeOfPoint(playerid,1716.99, 434.407, 30.7169, 0))
    {
    SetObjectRot(zoll3, 0.0000, 0.99993896484375, 339.99987792969);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll3", 3500, 0);
    }
    else if (IsPlayerInRangeOfPoint(playerid,1704.59, 450.542, 30.5653, 0))
    {
    SetObjectRot(zoll3, 0.0000, 0.99993896484375, 339.99987792969);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll4", 3500, 0);
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED,"You aren't at any toll station");
    return 1;
    }
    return 1;
    }
    return 0;
    }
    public GateCloseZoll1()
    {
    SetObjectRot(zoll1, 0.0000, 269.7591, 260.3054);
    return 1;
    }
    public GateCloseZoll2()
    {
    SetObjectRot(zoll2, 0.0000, 89.3814, 261.4057);
    return 1;
    }
    public GateCloseZoll3()
    {
    SetObjectRot(zoll3, 0.00000000, 90.75018311, 339.99987793);
    return 1;
    }
    public GateCloseZoll4()
    {
    SetObjectRot(zoll4, 0.00000000, 269.00000000, 341.99890137);
    return 1;
    }
    #endif


    xDD Schau mal auf den 4 Gate. Da steht SetObjectRot(zoll3, 0.0000, 0.99993896484375, 339.99987792969);


    Richtig


    SetObjectRot(zoll4, 0.0000, 0.99993896484375, 339.99987792969);


    Von der Zoll3 eine Zoll4.
    Dan müsste es gehen.
    mfg GangsteR08

    German Naza-eVolution RealLife(Online)
    Serverip: 62.75.242.41:7777(Wartungsarbeiten/Offline)
    Forum : NeV-Klick (Online)

  • Es liegt an den Koods oder am Radius , wie groß ist der Radius??


    Ich würde es mit einem Pickup machen und nicht mit InRangeOf


    lg


  • Du machst ein Pickup in den du dann reinfahren kannst, nachdem dies Erfogt, tippst du /zoll ein und die Schranke öffnet sich dann.


    Da du es selber lernen musst, solltest, werde ich hier nicht weiteres verraten außer wiki.sa-mp.com >> CreatePickup


    lg



  • Probiere es mal so:
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp(cmdtext, "/toll", true) == 0)
    {
    if(IsPlayerInRangeOfPoint(7.0,playerid, 48.7261,-1537.2622,5.0223))
    {
    SetObjectRot(zoll1, 0.0000, 359.1406, 260.3054);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll1", 3500, 0);
    }
    else if(IsPlayerInRangeOfPoint(7.0,playerid, 62.9513,-1526.6962,4.7878))
    {
    SetObjectRot(zoll2, 0.0000, 0.0000, 261.4057);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll2", 3500, 0);
    }
    else if(IsPlayerInRangeOfPoint(7.0,playerid,1716.99, 434.407, 30.7169))
    {
    SetObjectRot(zoll3, 0.0000, 0.99993896484375, 339.99987792969);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll3", 3500, 0);
    }
    else if(IsPlayerInRangeOfPoint(7.0,playerid, 1704.59, 450.542, 30.5653))
    {
    SetObjectRot(zoll4, 0.00000000, 269.00000000, 341.99890137);
    GameTextForPlayer(playerid, "~g~Expenses: ~r~-2500$", 5000, 1);
    GivePlayerMoney(playerid, -2500);
    SetTimer("GateCloseZoll4", 3500, 0);
    }
    else
    {
    return SendClientMessage(playerid, COLOR_RED,"You aren't at any toll station");
    }
    return 1;
    }
    return 0;
    }


    Falls es nicht funktioniert,lösch
    else
    {
    return SendClientMessage(playerid, COLOR_RED,"You aren't at any toll station");
    }
    Das mal raus und probiere es erneut!