Tor Bewegt sich falsch

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
  • dann versuch mal so



    ocmd:ftor(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,10,1530.1999511719, 482.39999389648, 8.3000001907349))
    {
    MoveDynamicObject(tor,1530.1999511719, 482.39999389648, 8.3000001907349-10,5);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,ROT,"Du bist nicht in der nähe vom Tor.");
    }
    return 1;
    }


    ocmd:ftorzu(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,10,1530.1999511719, 482.39999389648, 8.3000001907349))
    {
    MoveDynamicObject(tor,1530.1999511719, 482.39999389648, 8.3000001907349-,5);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,ROT,"Du bist nicht in der nähe vom Tor.");
    }
    return 1;
    }

  • Okay :D


    Oben
    new tor;



    //Fahrschule


    CreateDynamicObject(982,-1247.40002441,481.50000000,6.90000010,0.00000000,0.00000000,270.00000000); //object(fenceshit) (1)
    CreateDynamicObject(982,-1273.00000000,481.50000000,6.90000010,0.00000000,0.00000000,270.00000000); //object(fenceshit) (2)
    CreateDynamicObject(984,-1230.00000000,477.00000000,6.80000019,0.00000000,0.00000000,45.75000000); //object(fenceshit2) (1)
    CreateDynamicObject(983,-1223.19995117,470.29998779,6.90000010,0.00000000,0.00000000,44.75000000); //object(fenceshit3) (1)
    CreateDynamicObject(982,-1220.90002441,455.20001221,6.90000010,0.00000000,0.00000000,0.00000000); //object(fenceshit) (3)
    CreateDynamicObject(984,-1226.40002441,439.10000610,6.80000019,0.00000000,0.00000000,300.75000000); //object(fenceshit2) (2)
    CreateDynamicObject(982,-1244.69995117,436.00000000,6.90000010,0.00000000,0.00000000,269.25000000); //object(fenceshit) (5)
    CreateDynamicObject(982,-1270.30004883,436.10000610,6.90000010,0.00000000,0.00000000,270.25000000); //object(fenceshit) (devil)
    CreateDynamicObject(982,-1295.90002441,436.10000610,6.90000010,0.00000000,0.00000000,269.75000000); //object(fenceshit) (7)
    CreateDynamicObject(982,-1321.50000000,436.10000610,6.90000010,0.00000000,0.00000000,270.25000000); //object(fenceshit) (music)
    CreateDynamicObject(983,-1336.90002441,437.89999390,6.90000010,0.00000000,0.00000000,234.00000000); //object(fenceshit3) (4)
    CreateDynamicObject(982,-1233.69995117,460.20001221,6.90000010,0.00000000,0.00000000,269.00000000); //object(fenceshit) (9)
    CreateDynamicObject(984,-1252.90002441,460.50000000,6.80000019,0.00000000,0.00000000,269.25000000); //object(fenceshit2) (3)
    CreateDynamicObject(984,-1259.40002441,475.10000610,6.80000019,0.00000000,0.00000000,0.00000000); //object(fenceshit2) (4)
    CreateDynamicObject(1251,-1221.00000000,463.39999390,6.30000019,0.00000000,0.00000000,0.00000000); //object(smashbar) (1)
    CreateDynamicObject(1251,-1223.69995117,463.39999390,6.30000019,0.00000000,0.00000000,0.00000000); //object(smashbar) (2)
    CreateDynamicObject(1251,-1226.30004883,463.39999390,6.30000019,0.00000000,0.00000000,0.00000000); //object(smashbar) (3)
    CreateDynamicObject(8843,-1511.59997559,465.20001221,6.19999981,0.00000000,0.00000000,268.00000000); //object(arrows01_lvs) (1)
    CreateDynamicObject(8843,-1465.40002441,463.70001221,6.19999981,0.00000000,0.00000000,267.99499512); //object(arrows01_lvs) (2)
    CreateDynamicObject(8843,-1465.00000000,475.70001221,6.19999981,0.00000000,0.00000000,88.00000000); //object(arrows01_lvs) (3)
    CreateDynamicObject(8843,-1511.00000000,477.89999390,6.19999981,0.00000000,0.00000000,87.99499512); //object(arrows01_lvs) (4)
    CreateDynamicObject(5130,-1334.80004883,478.70001221,8.19999981,0.00000000,0.00000000,224.00000000); //object(imcompstrs02) (1)
    CreateDynamicObject(3115,-1456.69995117,501.29998779,17.00000000,0.00000000,0.00000000,0.00000000); //object(carrier_lift1_sfse) (1)
    CreateDynamicObject(3114,-1414.50000000,516.40002441,16.70000076,0.00000000,0.00000000,0.00000000); //object(carrier_lift2_sfse) (1)
    CreateDynamicObject(16770,-1448.69995117,500.10000610,11.80000019,0.00000000,0.00000000,0.00000000); //object(des_gunbldg01) (1)
    CreateDynamicObject(1588,-1467.30004883,495.89999390,14.10000038,0.00000000,0.00000000,0.00000000); //object(tar_top) (2)
    CreateDynamicObject(1588,-1467.30004883,498.29998779,12.60000038,0.00000000,0.00000000,0.00000000); //object(tar_top) (4)
    CreateDynamicObject(1588,-1467.30004883,499.39999390,14.30000019,0.00000000,0.00000000,0.00000000); //object(tar_top) (5)
    CreateDynamicObject(1588,-1467.30004883,501.20001221,12.19999981,0.00000000,0.00000000,0.00000000); //object(tar_top) (devil)
    CreateDynamicObject(1588,-1467.30004883,497.79998779,13.89999962,0.00000000,0.00000000,0.00000000); //object(tar_top) (7)
    CreateDynamicObject(1588,-1467.30004883,503.00000000,13.80000019,0.00000000,0.00000000,0.00000000); //object(tar_top) (music)
    CreateDynamicObject(1588,-1467.30004883,508.60000610,10.60000038,0.00000000,0.00000000,0.00000000); //object(tar_top) (9)
    CreateDynamicObject(1588,-1467.30004883,506.70001221,14.00000000,0.00000000,0.00000000,0.00000000); //object(tar_top) (10)
    CreateDynamicObject(1588,-1467.30004883,508.10000610,12.80000019,0.00000000,0.00000000,0.00000000); //object(tar_top) (11)
    CreateDynamicObject(1588,-1467.30004883,506.29998779,11.00000000,0.00000000,0.00000000,0.00000000); //object(tar_top) (12)
    CreateDynamicObject(1588,-1467.30004883,495.70001221,11.80000019,0.00000000,0.00000000,0.00000000); //object(tar_top) (13)
    CreateDynamicObject(1588,-1467.29980469,493.69921875,10.69999981,0.00000000,0.00000000,0.00000000); //object(tar_top) (14)
    CreateDynamicObject(1588,-1467.30004883,493.10000610,14.39999962,0.00000000,0.00000000,0.00000000); //object(tar_top) (15)
    CreateDynamicObject(1588,-1467.30004883,499.29998779,10.80000019,0.00000000,0.00000000,0.00000000); //object(tar_top) (16)
    CreateDynamicObject(1588,-1467.29980469,503.19921875,11.60000038,0.00000000,0.00000000,0.00000000); //object(tar_top) (17)
    CreateDynamicObject(1588,-1467.29980469,504.69921875,12.30000019,0.00000000,0.00000000,0.00000000); //object(tar_top) (18)
    CreateDynamicObject(9825,-1310.40002441,451.00000000,6.19999981,0.00000000,0.00000000,179.75000000); //object(carspaces3_sfw02) (2)
    CreateDynamicObject(1850,-1528.40002441,482.10000610,6.19999981,0.00000000,0.00000000,0.00000000); //object(shop_shelf08) (1)
    CreateDynamicObject(1850,-1531.69995117,482.10000610,6.19999981,0.00000000,0.00000000,0.00000000); //object(shop_shelf08) (2)
    CreateDynamicObject(16000,-1330.69995117,485.89999390,10.19999981,0.00000000,0.00000000,0.00000000); //object(drvin_screen) (1)
    CreateDynamicObject(3934,-1456.50000000,501.50000000,17.29999924,0.00000000,0.00000000,0.00000000); //object(helipad01) (1)
    CreateDynamicObject(1232,-1220.90002441,468.00000000,8.80000019,0.00000000,0.00000000,0.00000000); //object(streetlamp1) (1)
    CreateDynamicObject(1232,-1259.39941406,481.50000000,8.80000019,0.00000000,0.00000000,0.00000000); //object(streetlamp1) (2)
    CreateDynamicObject(1232,-1234.59960938,481.50000000,8.80000019,0.00000000,0.00000000,0.00000000); //object(streetlamp1) (3)
    CreateDynamicObject(1232,-1285.89941406,481.50000000,8.80000019,0.00000000,0.00000000,0.00000000); //object(streetlamp1) (4)
    CreateDynamicObject(1232,-1220.90002441,460.00000000,8.80000019,0.00000000,0.00000000,0.00000000); //object(streetlamp1) (5)
    CreateDynamicObject(1232,-1220.90002441,442.39999390,8.80000019,0.00000000,0.00000000,0.00000000); //object(streetlamp1) (devil)
    CreateDynamicObject(1232,-1231.90002441,435.79998779,8.80000019,0.00000000,0.00000000,0.00000000); //object(streetlamp1) (7)
    CreateDynamicObject(1232,-1334.30004883,436.00000000,8.80000019,0.00000000,0.00000000,0.00000000); //object(streetlamp1) (music)
    CreateDynamicObject(1232,-1337.90002441,452.20001221,8.80000019,0.00000000,0.00000000,0.00000000); //object(streetlamp1) (9)
    CreateDynamicObject(1214,-1338.90002441,453.00000000,6.19999981,0.00000000,0.00000000,0.00000000); //object(bollard) (2)
    CreateDynamicObject(1214,-1259.50000000,460.60000610,6.19999981,0.00000000,0.00000000,0.00000000); //object(bollard) (3)
    CreateDynamicObject(1215,-1338.40002441,453.00000000,6.80000019,0.00000000,0.00000000,0.00000000); //object(bollardlight) (1)
    CreateDynamicObject(1215,-1338.59997559,486.00000000,10.69999981,0.00000000,0.00000000,0.00000000); //object(bollardlight) (2)
    CreateDynamicObject(1215,-1309.29980469,465.79980469,6.80000019,0.00000000,0.00000000,0.00000000); //object(bollardlight) (3)
    CreateDynamicObject(1215,-1309.29980469,457.29980469,6.80000019,0.00000000,0.00000000,0.00000000); //object(bollardlight) (4)
    CreateDynamicObject(1215,-1324.69921875,442.59960938,6.69999981,0.00000000,0.00000000,0.00000000); //object(bollardlight) (5)
    CreateDynamicObject(1482,-1257.90002441,474.70001221,7.59999990,0.00000000,0.00000000,0.00000000); //object(dyn_garrage1) (1)
    tor = CreateDynamicObject(971, -1530.1999511719, 482.39999389648, 8.3000001907349, 0, 0, 0);



    ocmd:ftor(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,1000,1530.1999511719, 482.39999389648, 8.3000001907349))
    {
    MoveDynamicObject(tor,1530.1999511719, 482.39999389648, 8.3000001907349-10,5);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,ROT,"Du bist nicht in der nähe vom Tor.");
    }
    return 1;
    }


    ocmd:ftorzu(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,1000,1530.1999511719, 482.39999389648, 8.3000001907349))
    {
    MoveDynamicObject(tor,1530.1999511719, 482.39999389648, 8.3000001907349,5);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,ROT,"Du bist nicht in der nähe vom Tor.");
    }
    return 1;
    }

    2 Mal editiert, zuletzt von Valentino46 () aus folgendem Grund: ....

  • ocmd:ftor(playerid,params[])
    {
    if(!IsPlayerInRangeOfPoint(playerid,10,-1259.4000244141, 465.89999389648, 3.4000000953674))return SendClientMessage(playerid,ROT,"Du bist nicht in der Nähe vom Tor");
    MoveObject(tor,1259.4000244141, 465.89999389648, 3.4000000953674-10,5); //spaß
    return 1;
    }


    ocmd:ftorzu(playerid,params[])
    {
    if(!IsPlayerInRangeOfPoint(playerid,10,-1259.4000244141, 465.89999389648, 3.4000000953674))return SendClientMessage(playerid,ROT,"Du bist nicht in der Nähe vom Tor");
    MoveObject(tor,1259.4000244141, 465.89999389648, 3.400000095367410,5); //spaß
    return 1;


    Versuchs mal so

  • Du hast das - vor der ersten koordinate vergessen.


    Wenn du es bei
    -1530.1999511719, 482.39999389648, 8.3000001907349
    erstellst und es nach
    1530.1999511719, 482.39999389648, 8.3000001907349
    bewegst liegen da 3000 Einheiten dazwischen, so breit ist nichtmal ganz SA...


    Mach das erste MoveObject zu dem:
    MoveObject(ftor, -1530.1999511719, 482.39999389648, 0.3000001907349,5.0);
    Und das zweite:
    MoveObject(ftor, -1530.1999511719, 482.39999389648, 8.3000001907349,5.0);

  • Bei eienem Boolean kannst du mit 1. Befehl das Tor öffnen und schließen^^
    Bei dir müsste das Ungefähr so aussehen:
    new bool:fstor;
    ocmd:ftor(playerid,params[])
    {
    if(!IsPlayerInRangeOfPoint(playerid,10,-1259.4000244141, 465.89999389648, 3.4000000953674))
    {
    if(fstor == false)
    {
    MoveObject(tor,1259.4000244141, 465.89999389648, 3.4000000953674-10,5); //spaß
    fstor = true;
    }
    if(fstor == true)
    {
    MoveObject(tor,1259.4000244141, 465.89999389648, 3.400000095367410,5); //spaß
    fstor = false;
    }
    }
    else
    {
    SendClientMessage(playerid,BLAU,"Du bist nicht in der nähe des Ftores!");
    }
    return 1;
    }