SA-MP Forums Archive
What streamer/code should I use for barriers/moveable gates - 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: What streamer/code should I use for barriers/moveable gates (/showthread.php?tid=370441)



What streamer/code should I use for barriers/moveable gates - davelord - 20.08.2012

Title, basically. Which streamer or code should I use for barriers or just openable gates?


Re: What streamer/code should I use for barriers/moveable gates - ThePhenix - 20.08.2012

pawn Код:
#include <a_samp>
new Gate, bool:GateClosed = true;

public OnGameModeInit()
{
    Gate = CreateObject(16775, 400.93, 2482.12, 19.52,   3.14, 0.0, 0.0, 0.0, 100.0);
    return 1;
}

CMD:/gate(playerid, params[])
{
    if(GateClosed){
        if(IsPlayerInRangeOfPoint(playerid, 0.00, 400.93, 2482.12, 19.52,   3.14)){
            GateClosed = false;
            MoveObject(Gate, 403.99, 2482.45, 19.52,   3.14, 3.0, 0.0, 0.0, 0.0);
            return SendClientMessage(playerid, 0xFFFFFFFF, "You have open this gate");
        }
    }
    else{
        if(IsPlayerInRangeOfPoint(playerid, 0.00, 400.93, 2482.12, 19.52,   3.14)){
            GateClosed = true;
            MoveObject(Gate, 400.93, 2482.12, 19.52,   3.14, 3.0, 0.0, 0.0, 0.0);
            return SendClientMessage(playerid, 0xFFFFFFFF, "You have close this gate");
        }
    }
}
It will open and close a gate


Re: What streamer/code should I use for barriers/moveable gates - SnG.Scot_MisCuDI - 20.08.2012

Streamer (optional)

IsPlayerInRangeOfPoint
MoveObject (no streamer)

MoveDynamicObject (streamer)

[He should explain what each line does in his code, i would do it for him but im going to sleep]


Re: What streamer/code should I use for barriers/moveable gates - ThePhenix - 20.08.2012

Yes, you're right, the PAWNO code that I made, is designed without Streamer.

So It will use, IsPlayerInRangeOfPoint and MoveObject!