sehr viele Objecte Move // 48 Stück

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
  • Hey Leute,
    Ich brauche dringent hilfe bei einem Befehl, undzwar habe ich einen Befehl erstellt wo 48 Gates Gemovt werden sollen.
    Beim Compilen gab es keine Fehler oder Warnings, nun habe ich es Ingame versucht aber nur ein Gate bewegt sich.
    Ich bitte um Hilfe z.B ein Beispiel womit man mehrere Objecte aufeinmal Moven kann.



    Mfg Mars.

    **~~Favorite~~**

  • Hier der Code


    new derbytore;

    zum öffnen:


    }
    if(strcmp(cmdtext,"/derbyauf", true) == 0)
    {
    if(isPlayerAnAdmin(playerid,1))
    {
    if(IsPlayerInRangeOfPoint(playerid,30.0,-1462.0153,940.1052,1036.6158))
    {
    MoveObject(derbytore,-1457.50000000,943.50000000,1035.69995117-10,6);
    MoveObject(derbytore,-1468.59997559,947.90002441,1035.80004883-10,6);
    MoveObject(derbytore,-1479.30004883,953.29998779,1035.90002441-10,6);
    MoveObject(derbytore,-1489.69995117,959.40002441,1036.00000000-10,6);
    MoveObject(derbytore,-1498.19995117,967.90002441,1036.19995117-10,6);
    MoveObject(derbytore,-1505.80004883,977.09997559,1036.30004883-10,6);
    MoveObject(derbytore,-1509.40002441,988.50000000,1036.50000000-10,6);
    MoveObject(derbytore,-1509.69995117,1000.50000000,1036.69995117-10,6);
    MoveObject(derbytore,-1506.19995117,1012.00000000,1036.90002441-10,6);
    MoveObject(derbytore,-1499.69995117,1022.40002441,1037.09997559-10,6);
    MoveObject(derbytore,-1490.80004883,1030.40002441,1037.19995117-10,6);
    MoveObject(derbytore,-1481.30004883,1037.69995117,1037.30004883-10,6);
    MoveObject(derbytore,-1470.50000000,1042.90002441,1037.40002441-10,6);
    MoveObject(derbytore,-1459.30004883,1047.30004883,1037.40002441-10,6);
    MoveObject(derbytore,-1447.69995117,1050.09997559,1037.40002441-10,6);
    MoveObject(derbytore,-1435.90002441,1052.09997559,1037.50000000-10,6);
    MoveObject(derbytore,-1424.00000000,1053.30004883,1037.50000000-10,6);
    MoveObject(derbytore,-1412.00000000,1053.30004883,1037.40002441-10,6);
    MoveObject(derbytore,-1400.00000000,1053.19995117,1037.40002441-10,6);
    MoveObject(derbytore,-1388.00000000,1053.19995117,1037.40002441-10,6);
    MoveObject(derbytore,-1376.00000000,1053.19995117,1037.40002441-10,6);
    MoveObject(derbytore,-1364.00000000,1053.09997559,1037.40002441-10,6);
    MoveObject(derbytore,-1352.30004883,1051.19995117,1037.30004883-10,6);
    MoveObject(derbytore,-1340.69995117,1048.40002441,1037.19995117-10,6);
    MoveObject(derbytore,-1329.50000000,1044.09997559,1037.09997559-10,6);
    MoveObject(derbytore,-1318.40002441,1039.59997559,1037.00000000-10,6);
    MoveObject(derbytore,-1308.50000000,1032.90002441,1036.90002441-10,6);
    MoveObject(derbytore,-1299.50000000,1025.09997559,1036.80004883-10,6);
    MoveObject(derbytore,-1291.09997559,1016.59997559,1036.59997559-10,6);
    MoveObject(derbytore,-1286.90002441,1005.40002441,1036.40002441-10,6);
    MoveObject(derbytore,-1285.19995117,993.50000000,1036.19995117-10,6);
    MoveObject(derbytore,-1288.69995117,982.00000000,1036.00000000-10,6);
    MoveObject(derbytore,-1294.80004883,971.70001221,1035.90002441-10,6);
    MoveObject(derbytore,-1302.59997559,962.70001221,1035.69995117-10,6);
    MoveObject(derbytore,-1312.19995117,955.59997559,1035.59997559-10,6);
    MoveObject(derbytore,-1322.59997559,949.59997559,1035.59997559-10,6);
    MoveObject(derbytore,-1333.50000000,944.70001221,1035.50000000-10,6);
    MoveObject(derbytore,-1345.00000000,941.20001221,1035.50000000-10,6);
    MoveObject(derbytore,-1356.80004883,939.09997559,1035.40002441-10,6);
    MoveObject(derbytore,-1368.69995117,937.90002441,1035.40002441-10,6);
    MoveObject(derbytore,-1380.80004883,938.20001221,1035.50000000-10,6);
    MoveObject(derbytore,-1392.80004883,938.29998779,1035.50000000-10,6);
    MoveObject(derbytore,-1404.80004883,938.29998779,1035.50000000-10,6);
    MoveObject(derbytore,-1416.80004883,938.29998779,1035.50000000-10,6);
    MoveObject(derbytore,-1428.80004883,938.50000000,1035.50000000-10,6);
    MoveObject(derbytore,-1440.69995117,939.40002441,1035.59997559-10,6);
    MoveObject(derbytore,-1452.30004883,942.40002441,1035.69995117-10,6);

    SendClientMessage(playerid,WEISS,"Du hast die Derby Tore geöffnet.");
    SendClientMessage(playerid,WEISS,"Um die Tore zuschließen benutze {5254A3}/derbyzu{FFFFFF}!");
    return 1;
    }
    SendClientMessage(playerid,ROT,"Du bist nicht in der Nähe vom dem Open Symbol!");
    return 1;
    }
    return 1;

    zum schließen:


    }
    if(strcmp(cmdtext,"/derbyzu", true) == 0)
    {
    if(isPlayerAnAdmin(playerid,1))
    {
    if(IsPlayerInRangeOfPoint(playerid,30.0,-1462.0153,940.1052,1036.6158))
    {

    MoveObject(derbytore,-1457.50000000,943.50000000,1035.69995117,6);
    MoveObject(derbytore,-1468.59997559,947.90002441,1035.80004883,6);
    MoveObject(derbytore,-1479.30004883,953.29998779,1035.90002441,6);
    MoveObject(derbytore,-1489.69995117,959.40002441,1036.00000000,6);
    MoveObject(derbytore,-1498.19995117,967.90002441,1036.19995117,6);
    MoveObject(derbytore,-1505.80004883,977.09997559,1036.30004883,6);
    MoveObject(derbytore,-1509.40002441,988.50000000,1036.50000000,6);
    MoveObject(derbytore,-1509.69995117,1000.50000000,1036.69995117,6);
    MoveObject(derbytore,-1506.19995117,1012.00000000,1036.90002441,6);
    MoveObject(derbytore,-1499.69995117,1022.40002441,1037.09997559,6);
    MoveObject(derbytore,-1490.80004883,1030.40002441,1037.19995117,6);
    MoveObject(derbytore,-1481.30004883,1037.69995117,1037.30004883,6);
    MoveObject(derbytore,-1470.50000000,1042.90002441,1037.40002441,6);
    MoveObject(derbytore,-1459.30004883,1047.30004883,1037.40002441,6);
    MoveObject(derbytore,-1447.69995117,1050.09997559,1037.40002441,6);
    MoveObject(derbytore,-1435.90002441,1052.09997559,1037.50000000,6);
    MoveObject(derbytore,-1424.00000000,1053.30004883,1037.50000000,6);
    MoveObject(derbytore,-1412.00000000,1053.30004883,1037.40002441,6);
    MoveObject(derbytore,-1400.00000000,1053.19995117,1037.40002441,6);
    MoveObject(derbytore,-1388.00000000,1053.19995117,1037.40002441,6);
    MoveObject(derbytore,-1376.00000000,1053.19995117,1037.40002441,6);
    MoveObject(derbytore,-1364.00000000,1053.09997559,1037.40002441,6);
    MoveObject(derbytore,-1352.30004883,1051.19995117,1037.30004883,6);
    MoveObject(derbytore,-1340.69995117,1048.40002441,1037.19995117,6);
    MoveObject(derbytore,-1329.50000000,1044.09997559,1037.09997559,6);
    MoveObject(derbytore,-1318.40002441,1039.59997559,1037.00000000,6);
    MoveObject(derbytore,-1308.50000000,1032.90002441,1036.90002441,6);
    MoveObject(derbytore,-1299.50000000,1025.09997559,1036.80004883,6);
    MoveObject(derbytore,-1291.09997559,1016.59997559,1036.59997559,6);
    MoveObject(derbytore,-1286.90002441,1005.40002441,1036.40002441,6);
    MoveObject(derbytore,-1285.19995117,993.50000000,1036.19995117,6);
    MoveObject(derbytore,-1288.69995117,982.00000000,1036.00000000,6);
    MoveObject(derbytore,-1294.80004883,971.70001221,1035.90002441,6);
    MoveObject(derbytore,-1302.59997559,962.70001221,1035.69995117,6);
    MoveObject(derbytore,-1312.19995117,955.59997559,1035.59997559,6);
    MoveObject(derbytore,-1322.59997559,949.59997559,1035.59997559,6);
    MoveObject(derbytore,-1333.50000000,944.70001221,1035.50000000,6);
    MoveObject(derbytore,-1345.00000000,941.20001221,1035.50000000,6);
    MoveObject(derbytore,-1356.80004883,939.09997559,1035.40002441,6);
    MoveObject(derbytore,-1368.69995117,937.90002441,1035.40002441,6);
    MoveObject(derbytore,-1380.80004883,938.20001221,1035.50000000,6);
    MoveObject(derbytore,-1392.80004883,938.29998779,1035.50000000,6);
    MoveObject(derbytore,-1404.80004883,938.29998779,1035.50000000,6);
    MoveObject(derbytore,-1416.80004883,938.29998779,1035.50000000,6);
    MoveObject(derbytore,-1428.80004883,938.50000000,1035.50000000,6);
    MoveObject(derbytore,-1440.69995117,939.40002441,1035.59997559,6);
    MoveObject(derbytore,-1452.30004883,942.40002441,1035.69995117,6);


    SendClientMessage(playerid,WEISS,"Du hast die Tore geschlossen.");
    return 1;
    }
    SendClientMessage(playerid,ROT,"Du bist nicht in der Nähe vom dem Close Symbol!");
    return 1;
    }
    return 1;


    Mfg Mars

    **~~Favorite~~**

  • mach mal
    new derbytore[48];
    und dann immer so



    MoveObject(derbytore[0],-1452.30004883,942.40002441,1035.69995117,6);
    MoveObject(derbytore[1],-1452.30004883,942.40002441,1035.69995117,6);
    MoveObject(derbytore[2],-1452.30004883,942.40002441,1035.69995117,6);

  • Wie sollen sich denn die Tore alle bewegen wenn du nur eine Variable hast, die du andauernd überschreibst?


    Array heißt hier der Schlüssel


    new derbytore[DIE ANZAHL]; // Oben


    // beim erstellen
    derbytore[0] = CreateObject(...);
    derbytore[1] = CreateObject(...);
    //Etc..


    //beim bewegen
    MoveObject(derbytore[0],...);
    MoveObject(derbytore[1],...);
    //Etc....

    "Bevor ich mir Informationen aus der "Bild" hole,
    werde ich anfangen, Wahlergebnisse danach vorauszusagen,
    neben welchen Busch unsere Katze gepinkelt hat."

    Margarete Stokowski