What streamer/code should I use for barriers/moveable gates
#1

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

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
Reply
#3

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]
Reply
#4

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

So It will use, IsPlayerInRangeOfPoint and MoveObject!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)