Bewegliche Objekte

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
  • Guten Morgen


    Habe folgendes Problem.


    So sieht es bei mir aus:


    Das Tor wurde rot gefärbt damit ihr es sieht



    [b]public[/b] OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    SetGameModeText("LyL 2.1.0");
    CreateDynamicObject(19549, 3322.92822, -321.78671, 6.53650, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19539, 3275.42944, -321.78671, 6.53650, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19541, 3236.67969, -321.78671, 6.53650, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19541, 3221.67993, -321.78671, 6.53650, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19529, 3276.67993, -384.28558, 6.55212, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19529, 3276.67993, -384.28561, 6.53650, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19540, 3339.17651, -321.78671, 6.53650, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19549, 3339.17847, -338.03140, 6.53650, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19539, 3339.17847, -385.53021, 6.53650, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19541, 3339.17847, -424.27930, 6.53650, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19540, 3339.17847, -446.77490, 6.53650, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(19541, 3339.17847, -439.27640, 6.53650, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19549, 3322.92822, -446.77490, 6.53650, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(19539, 3275.42944, -446.77490, 6.53650, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(19541, 3236.67969, -446.77490, 6.53650, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(19541, 3221.67993, -446.77490, 6.53650, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(19540, 3214.18018, -446.77490, 6.53650, 0.00000, 0.00000, 180.00000);
    CreateDynamicObject(19541, 3214.18018, -439.27640, 6.53650, 0.00000, 0.00000, -180.00000);
    CreateDynamicObject(19541, 3214.18018, -424.27930, 6.53650, 0.00000, 0.00000, -180.00000);
    CreateDynamicObject(19539, 3214.20020, -385.52979, 6.53650, 0.00000, 0.00000, -180.00000);
    CreateDynamicObject(19549, 3214.18018, -338.03140, 6.53650, 0.00000, 0.00000, 180.00000);
    CreateDynamicObject(19540, 3214.18018, -321.78671, 6.53650, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(18802, 2858.34229, -328.58472, 6.90305, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(18789, 2943.26294, -328.58331, 8.99530, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(18789, 3093.25488, -328.58331, 8.99530, 0.00000, 0.00000, -180.00000);
    CreateDynamicObject(18802, 3178.25806, -328.58331, 6.90310, 0.00000, 0.00000, -180.00000);
    CreateDynamicObject(3330, 3169.92944, -329.89215, -1.49077, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(3330, 3115.91431, -329.89221, -1.49080, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(3330, 3054.54321, -329.89221, -1.49080, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(3330, 3017.04321, -329.89221, -1.49080, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(3330, 2971.54321, -329.89221, -1.49080, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(3330, 2915.04321, -329.89221, -1.49080, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(3330, 2867.01929, -329.89221, -1.49080, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(3749, 3193.29590, -328.17111, 11.26880, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(3528, 3190.20923, -335.64481, 11.35930, 0.00000, 0.00000, 175.86360);
    CreateDynamicObject(2990, 3193.80981, -317.51901, 9.22570, 0.00000, 0.00000, 262.60550);
    CreateDynamicObject(3528, 3187.00000, 9287.00000, -335.00000, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(3528, 3189.24292, -320.26050, 11.35930, 0.00000, 0.00000, 175.86360);
    CreateDynamicObject(1331, 3185.63159, -320.30161, 6.28450, 0.00000, 6.50000, 11.91240);
    CreateDynamicObject(19966, 2854.61694, -321.97159, 6.73600, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3163.51611, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3152.81592, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3142.49316, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3132.06641, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3121.92407, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3111.51904, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3099.96973, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3089.55127, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3079.08911, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3068.24512, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3058.05225, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3047.77124, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3037.44238, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3027.24121, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3016.60059, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 3005.63135, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2995.18433, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2984.87622, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2974.52710, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2963.77515, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2952.18945, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2940.85107, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2929.16846, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2916.83008, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2904.54956, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2891.91724, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2881.10205, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(1597, 2870.52441, -328.88440, 11.91440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(9833, 3032.18164, -329.40823, 12.52407, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9833, 3000.71362, -329.40820, 12.52410, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9833, 2970.57080, -329.40820, 12.52410, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9833, 2923.14648, -329.40820, 12.52410, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9833, 2897.47021, -329.40820, 12.52410, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9833, 3062.18262, -329.40820, 12.52410, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9833, 3083.74292, -329.40820, 12.52410, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9833, 3103.35791, -329.40820, 12.52410, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9833, 3126.75781, -329.40820, 12.52410, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9833, 3145.99097, -329.40820, 12.52410, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9833, 3167.81348, -329.40820, 12.52410, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -342.71011, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(13722, 3182.69873, -382.58640, 12.49310, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(13831, 3183.10718, -382.58490, 12.49300, 0.00000, 0.00000, -90.00000);
    CreateDynamicObject(19378, 3192.50562, -352.34329, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -361.97791, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -371.61270, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -381.24680, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -390.88089, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -400.51480, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -410.14911, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -419.78351, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -429.41711, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -439.05130, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -448.68570, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3192.50562, -458.31921, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3195.98218, -466.56061, 11.42140, 0.00000, 0.00000, 45.74500);
    CreateDynamicObject(19378, 3204.30908, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3213.94312, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3223.57642, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3233.20972, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3242.84277, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3252.47363, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3262.10693, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3271.74072, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3281.37329, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3291.00781, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3300.64136, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3310.27295, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3319.90601, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3329.53955, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3339.17383, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3348.80762, -469.94229, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3357.19678, -466.61938, 11.42140, 0.00000, 0.00000, 133.20970);
    CreateDynamicObject(19378, 3360.73267, -458.44119, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -448.80701, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -439.17310, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -429.54111, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -419.90948, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -410.27710, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -400.64279, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -391.00891, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -381.37479, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73169, -371.74069, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -362.10791, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -352.47931, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -342.84610, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -333.21201, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -323.58209, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -313.94690, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3360.73267, -304.31479, 11.42140, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(19378, 3355.82666, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3346.19385, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3336.55981, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3326.92822, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3317.29492, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3307.66089, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3298.02905, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3288.39575, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3278.76392, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3269.12964, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3259.49731, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3249.86353, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3240.22998, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3230.59546, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3220.96118, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3211.32690, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3201.69263, -299.58621, 11.42140, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(19378, 3195.77344, -304.36581, 11.42140, 0.00000, 0.00000, 167.83170);
    CreateDynamicObject(19378, 3194.18237, -313.86591, 11.42140, 0.00000, 0.00000, 353.14429);
    CreateDynamicObject(19171, 3195.39771, -334.74100, 8.47590, 90.00000, 90.00000, 0.00000);
    CreateDynamicObject(19169, 3195.39771, -334.74100, 9.97490, 90.00000, 90.00000, 0.00000);
    CreateDynamicObject(19170, 3195.39771, -336.23801, 8.47590, 90.00000, 90.00000, 0.00000);
    CreateDynamicObject(19168, 3195.39771, -336.23801, 9.97490, 90.00000, 90.00000, 0.00000);
    CreateDynamicObject(10377, 3335.31470, -357.28540, 24.60800, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9132, 3328.31567, -389.35059, 47.94619, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(9132, 3328.31567, -325.27130, 47.94620, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(7388, 3193.23730, -328.48801, 15.93970, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(8419, 3249.88135, -440.66510, 18.26440, 0.00000, 0.00000, 90.00000);
    CreateDynamicObject(9062, 3270.60864, -351.78799, 6.58930, 0.00000, 0.00000, 0.00000);
    CreateDynamicObject(9090, 3274.18872, -287.35779, -27.00420, 0.00000, 0.00000, 180.23430);
    [font='Lucida Sans Unicode, Lucida Grande, sans-serif'][size=14][color=#FF0000][b][i][u] CreateDynamicObject(980, 3193.15967, -328.29831, 9.13039, 0.00000, 0.00000, 90.00000); [/u][/i][/b][/color][/size][/font]
    [b]return[/b] 1;
    }



    OCMD: Befehle:


    Tor auf und Tor zu:


    ocmd:saedtorauf(playerid,params[])
    {
    [b]new[/b] objectid = CreateDynamicObject(980, 3193.15967, -328.29831, 9.13039, 0.00000, 0.00000, 90.00000);
    MoveObject(objectid,3193.15967, -328.29831,3.16775,5,0.00000, 0.00000, 90.00000);
    SendClientMessage(playerid,blau,"SAED Tor Wurde geöffnet!");
    [b]return[/b] 1;
    }
    ocmd:saedtorzu(playerid,params[])
    {
    [b]new[/b] objectid = CreateDynamicObject(980, 3193.15967, -328.29831, 9.13039, 0.00000, 0.00000, 90.00000);
    MoveObject(objectid,3193.15967, -328.29831,3.16775,5,0.00000, 0.00000, 90.00000);
    SendClientMessage(playerid,blau,"SAED Tor Wurde geschlossen!");
    [b]return[/b] 1;
    }

  • Du musst es so machen:


    Unter den Includes:
    new myGate;


    Bei OnGameModeInit:
    CreateDynamicObject(980, 3193.15967, -328.29831, 9.13039, 0.00000, 0.00000, 90.00000);
    zu:
    myGate = CreateDynamicObject(980, 3193.15967, -328.29831, 9.13039, 0.00000, 0.00000, 90.00000);


    Und die Befehle so:
    ocmd:saedtorauf(playerid,params[])
    {
    MoveDynamicObject(myGate,3193.15967, -328.29831, 3.16775, 5.0, 0.00000, 0.00000, 90.00000);
    SendClientMessage(playerid,blau,"SAED Tor Wurde geöffnet!");
    return 1;
    }
    ocmd:saedtorzu(playerid,params[])
    {
    MoveDynamicObject(myGate,3193.15967, -328.29831, 9.13039, 5.0, 0.00000, 0.00000, 90.00000);
    SendClientMessage(playerid,blau,"SAED Tor Wurde geschlossen!");
    return 1;
    }

  • Das kann so nicht funktioniert haben, da du jedes mal ein neues Objekt erstellst, an der Zu-Position.
    Außerdem hast du MoveObject anstatt MoveDynamicObject verwendet und die Koordinate beim Schließen-Befehl hat nicht gepasst (war bei Z auch 3 anstatt 9).


    Wenn es mal geklappt hat, dann war das bestimmt anders, denn wenn du jedes mal das Objekt neu erstellst, kann es nicht klappen, dann hast du an der Stelle irgendwann 1000x das gleiche Objekt. ;)

  • Ich nehme als Beispiel einfach diese Objekt, da machst du es dann so:


    Unter den Includes:
    new myGate;
    new bool:myGateStatus;


    Bei OnGameModeInit:
    CreateDynamicObject(980, 3193.15967, -328.29831, 9.13039, 0.00000, 0.00000, 90.00000);
    zu:
    myGate = CreateDynamicObject(980, 3193.15967, -328.29831, 9.13039, 0.00000, 0.00000, 90.00000);


    Und der Befehl so:
    ocmd:saedtorauf(playerid,params[])
    {
    if(myGateStatus) return SendClientMessage(playerid, 0xFF0000FF, "Error: Das Tor ist bereits offen.");
    MoveDynamicObject(myGate,3193.15967, -328.29831, 3.16775, 5.0, 0.00000, 0.00000, 90.00000);
    SendClientMessage(playerid,blau,"SAED Tor Wurde geöffnet!");
    SetTimerEx("saedtorzu_timer", 5000, false, "d", playerid);
    myGateStatus = true;
    return 1;
    }


    Und der Timer:
    forward saedtorzu_timer(playerid);
    public saedtorzu_timer(playerid);
    {
    MoveDynamicObject(myGate,3193.15967, -328.29831, 9.13039, 5.0, 0.00000, 0.00000, 90.00000);
    SendClientMessage(playerid,blau,"SAED Tor Wurde geschlossen!");
    myGateStatus = false;
    return 1;
    }

  • @Jeffry.
    Danke geht soweit jetzt aber ich habe jetzt versucht in ein extra script in ein ocmd-befehl mit
    einer Schleife zu fragen ob der Spieler in der Reichweite des Punktes ist.
    Wenn ja soll er öffnen und wenn nicht halt das Tor schließen.


    Der Code sieht so aus:


    ocmd:torauf(playerid,params[])
    {
    [b]if[/b](!IsPlayerInRangeOfPoint(playerid,1,3193.15967, -328.29831,9.13039))
    {
    [b]if[/b](saedtorstatus)[b]return[/b] SendClientMessage(playerid,blau,"Error: Das Tor ist bereits offen");
    MoveDynamicObject(saedtor,3193.15967, -328.29831, 9.13039,5.0,0.00000, 0.00000, 90.00000);
    SendClientMessage(playerid,blau,"SAED Tor wurde geöffnet!");
    SetTimerEx("saedtorzu_timer",5000,false,"d",playerid);
    saedtorstatus = true;
    }
    [b]else[/b]
    {
    MoveDynamicObject(saedtor,3193.15967, -328.29831,9.13039,5,0.00000, 0.00000, 90.00000);
    SendClientMessage(playerid,blau,"SAED Tor wurde geschlossen");
    saedtorstatus = false;
    [b]return[/b] 1;
    }
    }

  • Ah, ok, dann meinst du es so?
    ocmd:torauf(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid, 10.0, 3193.15967, -328.29831, 9.13039)) return SendClientMessage(playerid, 0xFF0000FF, "Error: Du bist nicht nahe dem Tor.");
    if(SpielerInfo[playerid][pFraktion] != 1) return SendClientMessage(playerid, 0xFF0000FF, "Error: Du bist nicht in der Fraktion."); //ANPASSEN!
    if(saedtorstatus) return SendClientMessage(playerid,blau,"Error: Das Tor ist bereits offen");
    MoveDynamicObject(saedtor,3193.15967, -328.29831, 9.13039,5.0,0.00000, 0.00000, 90.00000);
    SendClientMessage(playerid,blau,"SAED Tor wurde geöffnet!");
    SetTimerEx("saedtorzu_timer",5000,false,"d",playerid);
    saedtorstatus = true;
    return 1;
    }


    Beachte, dass du die Fraktionsabfrage anpassen musst, an deine Variablenbezeichnung.

  • Ich kenne den Code nicht, daher kann ich dir das nicht genau sagen.
    Prinzipiell musst du so vorgehen:


    Tor-Objekt dem Haus zuweisen (sprich im Haus-Enum einen Wert für die Objekt ID des Tors anlegen und das Tor dort zuweisen).


    Dann abfragen, bei welchem Tor der Spieler ist, dann weißt du auch das Haus, und dann abfragen ob der Spieler dieses Haus besitzt.