SA-MP Forums Archive
Movable Gates + REEEEEEEEEEEEEEEP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Movable Gates + REEEEEEEEEEEEEEEP (/showthread.php?tid=312764)



Movable Gates + REEEEEEEEEEEEEEEP - Gooday - 22.01.2012

Hello guys i will give reputation if someone could make for me wiith ZCMD a command for open these gates;

Gate closed:

Quote:

CreateObject(11327, -2099.5, -2252.8000488281, 32.200000762939, 0, 0, 52);
CreateObject(11327, -2107.3999023438, -2246.3999023438, 32.200000762939, 0, 0, 50);

Gate Open:
Quote:

CreateObject(11327, -2099.5, -2252.8000488281, 28, 0, 0, 52);
CreateObject(11327, -2107.3999023438, -2246.3999023438, 28, 0, 0, 50);

I wanna make a command /open and /close Thanks +rep!


Re: Movable Gates + REEEEEEEEEEEEEEEP - mineralo - 22.01.2012

pawn Код:
new gate[2];
public OnGameModeInit()
{
gate[0] = CreateObject(11327, -2099.5, -2252.8000488281, 32.200000762939, 0, 0, 52);
gate[1] = CreateObject(11327, -2107.3999023438, -2246.3999023438, 32.200000762939, 0, 0, 50);
return 1;
}
OnPlayerCommandText(playerid,text)
{
if (strcmp(cmdtext, "/opengate1", true) == 0)
    {
    MoveObject(gate[0], -2099.5, -2252.8000488281, 28, 2.00);
    return 1;
}
if (strcmp(cmdtext, "/opengate2", true) == 0)
    {
    MoveObject(gate[1], -2107.3999023438, -2246.3999023438, 28, 2.00);
    return 1;
}
if (strcmp(cmdtext, "/closegate1", true) == 0)
    {
    MoveObject(gate[0], -2099.5, -2252.8000488281, 32.200000762939, 2.00);
    return 1;
}
if (strcmp(cmdtext, "/closegate2", true) == 0)
    {
    MoveObject(gate[1], -2107.3999023438, -2246.3999023438, 32.200000762939,  2.00);
    return 1;
}
return 1;
}
sorry, I don't use zcmd


Re: Movable Gates + REEEEEEEEEEEEEEEP - [XST]O_x - 22.01.2012

pawn Код:
new gate[2],bool:isopened[2] = false;

public OnGameModeInit()
{
    gate[0] = CreateObject(11327, -2099.5, -2252.8000488281, 32.200000762939, 0, 0, 52);
    gate[1] = CreateObject(11327, -2107.3999023438, -2246.3999023438, 32.200000762939, 0, 0, 50);
    return 1;
}

COMMAND:gate1(playerid,params[])
{
    if(isopened[0] == false)
    {
        MoveObject(gate[0], -2099.5, -2252.8000488281, 28, 2.00);
        isopened[0] = true;
    }
    else
    {
        MoveObject(gate[0], -2099.5, -2252.8000488281, 32.200000762939, 2.00);
        isopened[0] = false;
    }
    return 1;
}

COMMAND:gate2(playerid,params[])
{
    if(isopened[1] == false)
    {
        MoveObject(gate[1], -2107.3999023438, -2246.3999023438, 28, 2.00);
        isopened[1] = true;
    }
    else
    {
        MoveObject(gate[1], -2107.3999023438, -2246.3999023438, 32.200000762939,  2.00);
        isopened[1] = false;
    }
    return 1;
}
In zcmd.


Re: Movable Gates + REEEEEEEEEEEEEEEP - Gooday - 22.01.2012

It works! the coords are good but the gate rotate and goes down and it wong go just down it make a 180* rotation O.o


Re: Movable Gates + REEEEEEEEEEEEEEEP - Lilcuete - 22.01.2012

Use mta map editor it helps you.http://mtavc.com/