Need help with this
#1

There are no errors in this this script , but there are bugs. I Put 3 moving objects

Код:
ufo  = CreateObject(3256, 268.6500, 1883.0900, -35.0000,   0.00, 0.00, 110.00);
	ufo1 = CreateObject(3258,  268.6500, 1883.0900, -2.9000, 0.0000, 0.0000, 0.0000);
	ufo2 = CreateObject(3243,  268.7200, 1883.0200, 23.5000, 0.0000, 0.0000, 0.0000);
But only the first one is moving. Anyone help me to move all these 3 things at the same size and shape.below red portion is not working

pawn Код:
#include <a_samp>
new ufo;
new ufo1;
new ufo2;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" MoonTravel v0.2");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else


#endif

public OnGameModeInit()
{
    CreateObject(17511, 267.85, 1804.19, 763.86,   0.00, 0.00, 0.00);
    CreateObject(975, 272.02, 1875.11, 773.12,   88.52, 0.00, 268.28);
    CreateObject(975, 272.36, 1884.41, 773.12,   88.52, 0.00, 268.28);
    CreateObject(975, 270.66, 1885.93, 773.08,   0.00, 0.00, 270.00);
    CreateObject(975, 270.68, 1877.71, 774.08,   0.00, 0.00, 270.00);
    CreateObject(975, 273.78, 1884.34, 774.08,   0.00, 0.00, 270.00);
    CreateObject(975, 273.65, 1876.91, 774.08,   0.00, 0.00, 270.00);
    CreateObject(10828, 283.02, 1871.00, 771.85,   268.04, 0.00, 270.00);
    CreateObject(10828, 287.34, 1866.36, 772.40,   268.04, 0.00, 247.50);
    CreateObject(10828, 264.32, 1872.79, 774.66,   0.00, 0.00, 270.00);
    CreateObject(6295, 285.87, 1876.46, 795.86,   0.00, 0.00, 67.50);
    CreateObject(17511, 263.75, 1799.57, 749.86,   177.80, 0.00, 0.00);
    CreateObject(10828, 267.82, 1875.32, 769.99,   0.00, 0.00, 180.00);
    CreateObject(10828, 268.24, 1875.61, 758.49,   0.00, 0.00, 180.00);
    CreateObject(10828, 276.75, 1872.80, 772.42,   0.00, 0.00, 90.00);
    CreateObject(10828, 272.63, 1889.65, 773.92,   0.00, 0.00, 360.00);
    CreateObject(3400, 268.38, 1882.74, 18.77,   0.00, 0.00, 180.00);
    CreateObject(3400, 268.38, 1882.74, 23.40,   0.00, 0.00, 180.00);
    CreateObject(16665, 262.42, 1802.01, 6.41,   0.00, 0.00, 180.00);
    CreateObject(16662, 273.79, 1801.53, 6.61,   0.00, 0.00, 243.00);
    CreateObject(16782, 275.44, 1801.96, 7.60,   0.00, 0.00, 180.00);
    CreateObject(2929, 228.33, 1872.30, 14.00,   0.00, 0.00, 90.00);
    CreateObject(3258, 268.65, 1883.09, -2.90,   0.00, 0.00, 0.00);
    CreateObject(987, 278.68, 1870.08, 17.00,   0.00, 0.00, 90.00);
    CreateObject(987, 278.63, 1881.67, 17.00,   0.00, 0.00, 90.00);
    CreateObject(987, 278.65, 1892.74, 17.00,   0.00, 0.00, 90.00);
    CreateObject(987, 266.93, 1870.12, 17.00,   0.00, 0.00, 0.00);
    CreateObject(987, 255.00, 1870.14, 17.00,   0.00, 0.00, 0.00);
    CreateObject(987, 255.16, 1881.82, 19.00,   0.00, 0.00, 270.00);
    CreateObject(987, 255.18, 1896.15, 19.00,   0.00, 0.00, 270.00);
    CreateObject(987, 255.16, 1904.49, 19.00,   0.00, 0.00, 270.00);
    CreateObject(987, 266.86, 1904.40, 17.00,   0.00, 0.00, 180.00);
    CreateObject(987, 278.73, 1904.39, 17.00,   0.00, 0.00, 180.00);
    CreateObject(987, 266.86, 1904.40, 19.00,   0.00, 0.00, 180.00);
    CreateObject(987, 278.73, 1904.39, 19.00,   0.00, 0.00, 180.00);
    CreateObject(987, 278.65, 1892.74, 19.00,   0.00, 0.00, 90.00);
    CreateObject(987, 278.63, 1881.67, 19.00,   0.00, 0.00, 90.00);
    CreateObject(987, 278.68, 1870.08, 19.00,   0.00, 0.00, 90.00);
    CreateObject(987, 266.93, 1870.12, 19.00,   0.00, 0.00, 0.00);
    CreateObject(987, 255.00, 1870.14, 19.00,   0.00, 0.00, 0.00);
    CreateObject(16614, -268.51, 1580.50, 70.00,   0.00, 0.00, 45.00);
    CreateObject(7981, -325.87, 1492.98, 79.00,   0.00, 0.00, 0.00);
    CreateObject(10810, -266.01, 1520.42, 79.00,   0.00, 0.00, 60.00);
    CreateObject(3763, -201.60, 1459.32, 104.80,   0.00, 0.00, 0.00);
    CreateObject(13758, -363.32, 1555.34, 91.00,   0.00, 0.00, 0.00);
    CreateObject(13714, -273.85, 1499.25, 85.00,   0.00, 0.00, 0.00);
    CreateObject(1682, -270.25, 1517.92, 90.00,   0.00, 0.00, 90.00);
    CreateObject(1682, -320.83, 1491.95, 90.00,   0.00, 0.00, 270.00);
    CreateObject(4874, -232.62, 1474.31, 76.00,   0.00, 0.00, 270.00);
    CreateObject(11319, 270.58, 1876.08, 17.90,   0.00, 0.00, 90.00);
    CreateObject(11319, 266.14, 1876.07, 17.90,   0.00, 0.00, 90.00);
    CreateObject(11319, 270.58, 1876.08, 22.90,   0.00, 0.00, 90.00);
    CreateObject(11319, 266.14, 1876.07, 22.90,   0.00, 0.00, 90.00);
    CreateObject(11319, 261.43, 1880.82, 22.90,   0.00, 0.00, 0.00);
    CreateObject(11319, 261.43, 1880.82, 17.90,   0.00, 0.00, 0.00);
    CreateObject(11319, 261.43, 1884.72, 17.90,   0.00, 0.00, 0.00);
    CreateObject(11319, 261.43, 1884.72, 22.90,   0.00, 0.00, 0.00);
    CreateObject(11319, 275.32, 1884.69, 22.90,   0.00, 0.00, 0.00);
    CreateObject(11319, 275.32, 1884.69, 17.90,   0.00, 0.00, 0.00);
    CreateObject(11319, 275.32, 1880.69, 22.90,   0.00, 0.00, 0.00);
    CreateObject(11319, 275.32, 1880.69, 17.90,   0.00, 0.00, 0.00);
    CreateObject(11319, 270.57, 1889.39, 22.90,   0.00, 0.00, 90.00);
    CreateObject(11319, 266.17, 1889.39, 22.90,   0.00, 0.00, 90.00);
    CreateObject(11319, 266.17, 1889.39, 17.90,   0.00, 0.00, 90.00);
    CreateObject(11319, 270.57, 1889.39, 17.90,   0.00, 0.00, 90.00);
    CreateObject(1536, 261.42, 1877.14, 16.70,   0.00, 0.00, -45.00);
    CreateObject(1536, 261.42, 1877.14, 18.70,   0.00, 0.00, -45.00);
    CreateObject(1536, 261.42, 1877.14, 20.70,   0.00, 0.00, -45.00);
    CreateObject(1536, 261.42, 1877.14, 22.70,   0.00, 0.00, -45.00);
    CreateObject(1536, 261.42, 1877.14, 23.30,   0.00, 0.00, -45.00);
    CreateObject(1536, 274.22, 1889.39, 23.30,   0.00, 0.00, -45.00);
    CreateObject(1536, 274.22, 1889.39, 21.30,   0.00, 0.00, -45.00);
    CreateObject(1536, 274.22, 1889.39, 19.30,   0.00, 0.00, -45.00);
    CreateObject(1536, 274.22, 1889.39, 17.30,   0.00, 0.00, -45.00);
    CreateObject(1536, 274.22, 1889.39, 16.30,   0.00, 0.00, -45.00);
    CreateObject(1536, 275.31, 1877.15, 23.30,   0.00, 0.00, -135.00);
    CreateObject(1536, 275.31, 1877.15, 21.30,   0.00, 0.00, -135.00);
    CreateObject(1536, 275.31, 1877.15, 19.30,   0.00, 0.00, -135.00);
    CreateObject(1536, 275.31, 1877.15, 17.30,   0.00, 0.00, -135.00);
    CreateObject(1536, 275.31, 1877.15, 16.30,   0.00, 0.00, -135.00);
    CreateObject(1536, 262.52, 1889.41, 23.30,   0.00, 0.00, -135.00);
    CreateObject(1536, 262.52, 1889.41, 21.30,   0.00, 0.00, -135.00);
    CreateObject(1536, 262.52, 1889.41, 19.30,   0.00, 0.00, -135.00);
    CreateObject(1536, 262.52, 1889.41, 17.30,   0.00, 0.00, -135.00);
    CreateObject(1536, 262.52, 1889.41, 16.30,   0.00, 0.00, -135.00);
    CreateObject(7927, 262.69, 1886.13, 25.77,   0.00, 90.00, 0.00);
    CreateObject(7927, 262.68, 1881.10, 25.77,   0.00, 90.00, 0.00);
    CreateObject(7927, 262.70, 1880.30, 25.77,   0.00, 90.00, 0.00);
    CreateObject(7927, 264.70, 1877.28, 25.77,   0.00, 90.00, 90.00);
    CreateObject(7927, 269.98, 1877.28, 25.77,   0.00, 90.00, 90.00);
    CreateObject(7927, 271.13, 1877.31, 25.77,   0.00, 90.00, 90.00);
    CreateObject(7927, 271.07, 1888.19, 25.77,   0.00, 90.00, 90.00);
    CreateObject(7927, 266.32, 1888.20, 25.77,   0.00, 90.00, 90.00);
    CreateObject(7927, 264.68, 1888.20, 25.77,   0.00, 90.00, 90.00);
    CreateObject(7927, 274.10, 1880.22, 25.77,   0.00, 90.00, 0.00);
    CreateObject(7927, 274.08, 1884.82, 25.77,   0.00, 90.00, 0.00);
    CreateObject(7927, 274.05, 1886.12, 25.77,   0.00, 90.00, 0.00);
    CreateObject(7927, 265.51, 1879.37, 25.77,   0.00, 90.00, 90.00);
    CreateObject(7927, 270.60, 1879.36, 25.77,   0.00, 90.00, 90.00);
    CreateObject(7927, 264.79, 1886.54, 25.77,   0.00, 90.00, 90.00);
    CreateObject(7927, 269.92, 1886.54, 25.77,   0.00, 90.00, 90.00);
    CreateObject(7927, 272.30, 1883.29, 25.77,   0.00, 90.00, 0.00);
    CreateObject(7927, 264.86, 1883.42, 25.77,   0.00, 90.00, 0.00);
    CreateObject(1536, 264.25, 1887.67, 25.80,   90.00, 0.00, -135.00);
    CreateObject(1536, 275.37, 1877.09, 25.80,   90.00, 0.00, -135.00);
    CreateObject(1536, 274.27, 1889.45, 25.80,   90.00, 90.00, -135.00);
    CreateObject(1536, 263.17, 1878.89, 25.80,   90.00, 90.00, -135.00);
    CreateObject(3243, 268.72, 1883.02, 23.50,   0.00, 0.00, 0.00);

    ufo  = CreateObject(3256, 268.6500, 1883.0900, -35.0000,   0.00, 0.00, 110.00);
    ufo1 = CreateObject(3258,  268.6500, 1883.0900, -2.9000, 0.0000, 0.0000, 0.0000);
    ufo2 = CreateObject(3243,  268.7200, 1883.0200, 23.5000, 0.0000, 0.0000, 0.0000);
}


public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerPrivmsg(playerid, recieverid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/up", true) == 0)
    {
        MoveObject(ufo, 268.65, 1883.09, 774.00, 3);
        SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
        return 1;
    }

    if (strcmp(cmdtext, "/down", true) == 0)
    {
        MoveObject(ufo, 268.6500, 1883.0900, -35.0000, 5);
        SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
        return 1;
    }
    if (strcmp(cmdtext, "/up", true) == 0)
    {
        MoveObject(ufo1, 268.65, 1883.09, 774.00, 3);
        SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
        return 1;
    }

    if (strcmp(cmdtext, "/down", true) == 0)
    {
        MoveObject(ufo1, 268.6500, 1883.0900, -2.9000, 5);
        SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
        return 1;
    }
    if (strcmp(cmdtext, "/up", true) == 0)
    {
        MoveObject(ufo2, 268.7174, 1883.0188, 832.4000, 3);
        SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
        return 1;
    }

    if (strcmp(cmdtext, "/down", true) == 0)
    {
        MoveObject(ufo2, 268.7200, 1883.0200, 23.5000, 5);
        SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
        return 1;
    }
    return 0;
}
Reply
#2

Use streamer, and change CreateObject to CreateDynamicObject, and MoveObject to MoveDynamicObject.

Streamer works better than just using CreateObject and MoveObject.
Reply
#3

That's pretty simple, because you're checking if the cmdtext array is equal to "/up" and if it is, you run that section of code and then return 1, which means any of the other code in that callback won't be run. Instead, why don't you have different command checks for each gate? Or if you want them all to happen at the same time, why don't you have all of the MoveObject code under one of the if statements?
Reply
#4

G4M3Ov3r - It is also not working.
JaTochNietDan - hm.. can you show me an example?
Reply
#5

Your ****ing with me right?

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/up", true) == 0)
    {
        MoveObject(ufo, 268.65, 1883.09, 774.00, 3);
        MoveObject(ufo1, 268.65, 1883.09, 774.00, 3);
                              MoveObject(ufo2, 268.7174, 1883.0188, 832.4000, 3);
        SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
        return 1;
    }

    if (strcmp(cmdtext, "/down", true) == 0)
    {
        MoveObject(ufo, 268.6500, 1883.0900, -35.0000, 5);
        MoveObject(ufo1, 268.6500, 1883.0900, -2.9000, 5);
        MoveObject(ufo2, 268.7200, 1883.0200, 23.5000, 5);
        SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
        return 1;
    }

    return 0;
}
Intead of typing a command and it matching 3 it match's one and does the same thing

Get it?

To try what gameover said do that to that to ^
Reply
#6

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
Your ****ing with me right?

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/up", true) == 0)
    {
        MoveObject(ufo, 268.65, 1883.09, 774.00, 3);
        MoveObject(ufo1, 268.65, 1883.09, 774.00, 3);
                              MoveObject(ufo2, 268.7174, 1883.0188, 832.4000, 3);
        SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
        return 1;
    }

    if (strcmp(cmdtext, "/down", true) == 0)
    {
        MoveObject(ufo, 268.6500, 1883.0900, -35.0000, 5);
        MoveObject(ufo1, 268.6500, 1883.0900, -2.9000, 5);
        MoveObject(ufo2, 268.7200, 1883.0200, 23.5000, 5);
        SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
        return 1;
    }

    return 0;
}
Intead of typing a command and it matching 3 it match's one and does the same thing

Get it?

To try what gameover said do that to that to ^
Exactly what JaTochNietDan said, but i didn't even read what the code was until now O.o, and Lol !!, i just saw CreateObject and told him to use streamer.. thought it was lags, but this is.. wow !
Reply
#7

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
That's pretty simple, because you're checking if the cmdtext array is equal to "/up" and if it is, you run that section of code and then return 1, which means any of the other code in that callback won't be run. Instead, why don't you have different command checks for each gate? Or if you want them all to happen at the same time, why don't you have all of the MoveObject code under one of the if statements?
He means that you need to have different commands to each gate.

do like /up to gate 1,up2 to gate 2 and up3 to gate 3.

Thats why its not working -.-' you have the same command to 3 different functions

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/up", true) == 0)
{
MoveObject(ufo, 268.65, 1883.09, 774.00, 3);
SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
return 1;
}

if (strcmp(cmdtext, "/down", true) == 0)
{
MoveObject(ufo, 268.6500, 1883.0900, -35.0000, 5);
SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
return 1;
}
if (strcmp(cmdtext, "/up2", true) == 0)
{
MoveObject(ufo1, 268.65, 1883.09, 774.00, 3);
SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
return 1;
}

if (strcmp(cmdtext, "/down2", true) == 0)
{
MoveObject(ufo1, 268.6500, 1883.0900, -2.9000, 5);
SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
return 1;
}
if (strcmp(cmdtext, "/up3", true) == 0)
{
MoveObject(ufo2, 268.7174, 1883.0188, 832.4000, 3);
SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
return 1;
}

if (strcmp(cmdtext, "/down3", true) == 0)
{
MoveObject(ufo2, 268.7200, 1883.0200, 23.5000, 5);
SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
return 1;
}
return 0;
}

Put like this
Reply
#8

Thanks brothers , it is working now.
Can you tell me how to save the position of this moving object?
Reply
#9

Quote:
Originally Posted by G4M3Ov3r
Посмотреть сообщение
Ehem.. Come again ?
Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/up", true) == 0)
{
MoveObject(ufo, 268.65, 1883.09, 774.00, 3);
MoveObject(ufo1, 268.65, 1883.09, 774.00, 3);
MoveObject(ufo2, 268.7174, 1883.0188, 832.4000, 3);
SendClientMessage(playerid, 0xDEEE20FF, "To the moon!");
return 1;
}

if (strcmp(cmdtext, "/down", true) == 0)
{
MoveObject(ufo, 268.6500, 1883.0900, -35.0000, 5);
MoveObject(ufo1, 268.6500, 1883.0900, -2.9000, 5);
MoveObject(ufo2, 268.7200, 1883.0200, 23.5000, 5);
SendClientMessage(playerid, 0xDEEE20FF, "Back to Earth!");
return 1;
}

return 0;
}

But this work fine for me.
Now Can you help me in saving the position of those moving objects?
Reply
#10

1 What save system are you using
2 Youll have to move the objects else where as they will have to be loaded from a file

This forum requires that you wait 120 seconds between posts. Please try again in 43 seconds. - Dear Forum, In the 43 seconds of my life i waste I wish youll make this 60 seconds. Regards IceCube
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)