MoveObject( Heelp
#1

This is to open the barrier at LSPD but when i open it ingame nothing happens Please help!
I'm using this code:

pawn Код:
if(newkeys & KEY_CROUCH && !(oldkeys & KEY_CROUCH)) //horn
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if(PlayerToPoint(15.0,playerid,1544.3,-1627.3,13.3))  //near barrier
            {
                if(IsACop(playerid) || PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS)
                {
                    if(barrier_to_garage == 0)
                    {
                        MoveObject(lspd_garage_barrier1, 1544.7,-1631, 13.4, 180, 180, 1.5);
                        barrier_to_garage = 1;
                        return 1;
                    }
                    else
                    {
                        MoveObject(lspd_garage_barrier1, 1544.7,-1631, 13.4, 180, 90, 1.5);
                        barrier_to_garage = 0;
                        return 1;
                    }
                }
            }
Reply
#2

Anyone?
Reply
#3

pawn Код:
PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS
Are you sure this is correct? It is syntactically correct, but is it logically correct?

Also get rid of old methods.
Reply
#4

Yeah that's correct, it's just so admins can open the barrier too
Reply
#5

Try just
Код:
PlayerInfo[playerid][pAdmin]
Reply
#6

You'd also need && instead of &, as & "adds" them.
Reply
#7

Also, it worked fine when i used SetObjectRot( but when i changed to MoveObject( the barrier got bugged..
Reply
#8

Quote:
Originally Posted by Mikkel_RE
Посмотреть сообщение
This is to open the barrier at LSPD but when i open it ingame nothing happens Please help!
I'm using this code:

pawn Код:
if(newkeys & KEY_CROUCH && !(oldkeys & KEY_CROUCH)) //horn
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if(PlayerToPoint(15.0,playerid,1544.3,-1627.3,13.3))  //near barrier
            {
                if(IsACop(playerid) || PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS)
                {
                    if(barrier_to_garage == 0)
                    {
                        MoveObject(lspd_garage_barrier1, 1544.7,-1631, 13.4, 180, 180, 1.5);
                        barrier_to_garage = 1;
                        return 1;
                    }
                    else
                    {
                        MoveObject(lspd_garage_barrier1, 1544.7,-1631, 13.4, 180, 90, 1.5);
                        barrier_to_garage = 0;
                        return 1;
                    }
                }
            }
pawn Код:
if(newkeys & KEY_CROUCH && !(oldkeys & KEY_CROUCH)) //horn
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if(PlayerToPoint(15.0,playerid,1544.3,-1627.3,13.3))  //near barrier
            {
                if(IsACop(playerid) || PlayerInfo[playerid][pAdmin] & ADMIN_ACCESS)
                {
                    if(barrier_to_garage == 0)
                    {
                        MoveObject(lspd_garage_barrier1, 1544.7,-1631, 13.4, 10.0, 180, 180, 1.5);
                        barrier_to_garage = 1;
                        return 1;
                    }
                    else
                    {
                        MoveObject(lspd_garage_barrier1, 1544.7,-1631, 13.4, 10.0, 180, 90, 1.5);
                        barrier_to_garage = 0;
                        return 1;
                    }
                }
            }
try this
Reply
#9

Nope it's still the same
Reply
#10

Quote:
Originally Posted by Mikkel_RE
Посмотреть сообщение
Nope it's still the same
Fuck knows then.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)