[Tutorial] Moving Objects
#19

Quote:
Originally Posted by Sweet_Mafia™
View Post
Can you please tell me what is wrong with this and correct it.

pawn Code:
//Los Santos Military Transportation Electric Gates

#include <a_samp>

new aGate;

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    aGate = CreateObject(976,2720.53076172,-2409.44506836,12.46093750,0.00000000,0.00000000,90 .00000000);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp("/gate", cmdtext, true, 10) == 0)
            {
            MoveObject (976,2720.53076172,-2401.33911133,12.46093750,0.00000000,0.00000000,90 .00000000);//This will move the gate
            }
            return 1;
        }
        if (strcmp("/closegate", cmdtext, true, 10) == 0)
            {
            MoveObject (976,2720.53076172,-2409.44506836,12.46093750,0.00000000,0.00000000,90 .00000000);//This will move the gate back to the old position
            }
            return 1;
        }

return 1;
}
Now it will work....

pawn Code:
#include <a_samp>

new aGate;

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    aGate = CreateObject(976,2720.53076172,-2409.44506836,12.46093750,0.00000000,0.00000000,90.00000000);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
        if(strcmp ("/gate", cmdtext, true) == 0)
            {
            MoveObject(aGate, 2720.53076172, -2401.33911133, 12.46093750,2);//This will move the gate
            return 1;
        }
        if(strcmp ("/closegate", cmdtext, true) == 0)
            {
            MoveObject(aGate, 2720.53076172, -2409.44506836, 12.46093750, 2);//This will move the gate back to the old position
            return 1;
        }

        return 0;
}
Reply


Messages In This Thread
Moving Objects - by SkizzoTrick - 01.12.2010, 16:31
Re: Moving Objects - by Ruffles. - 01.12.2010, 19:59
Re: Moving Objects - by SkizzoTrick - 01.12.2010, 20:16
Re: Moving Objects - by scripter1 - 01.12.2010, 20:51
Re: Moving Objects - by Mean - 03.12.2010, 21:19
Re: Moving Objects - by Sweet_Mafia™ - 04.12.2010, 20:17
Re: Moving Objects - by SkizzoTrick - 04.12.2010, 20:41
Re: Moving Objects - by Sweet_Mafia™ - 05.12.2010, 02:28
Re: Moving Objects - by Scenario - 05.12.2010, 02:53
Re: Moving Objects - by Sweet_Mafia™ - 05.12.2010, 08:40
Re: Moving Objects - by SkizzoTrick - 05.12.2010, 08:52
Re: Moving Objects - by omer5198 - 05.12.2010, 13:12
Re: Moving Objects - by Sweet_Mafia™ - 05.12.2010, 15:20
Re: Moving Objects - by Sweet_Mafia™ - 05.12.2010, 17:41
Re: Moving Objects - by SkizzoTrick - 05.12.2010, 17:50
Re: Moving Objects - by Sweet_Mafia™ - 05.12.2010, 20:34
Re: Moving Objects - by SkizzoTrick - 23.01.2011, 12:57
Re: Moving Objects - by whisperftw - 28.01.2011, 15:38
Re: Moving Objects - by ricardo178 - 28.01.2011, 18:09
Re: Moving Objects - by antonio112 - 05.02.2011, 12:30
Re: Moving Objects - by SkizzoTrick - 06.02.2011, 14:24
Re: Moving Objects - by [M.A]Angel[M.A] - 21.02.2011, 02:34
Re: Moving Objects - by boslosos - 13.05.2015, 07:10
Re: Moving Objects - by Mitchyjones - 18.08.2016, 04:07

Forum Jump:


Users browsing this thread: 1 Guest(s)