Need help in my /gate command...
#1

Hello fellow PAWN scripters.
Well at these time I got a problem that couse to a big problem...

The problem is that baracade won't go up and the other one is that the garage port won't go down

Code;

pawn Код:
if(strcmp(cmdtext, "/gate", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,9,1588.3058,-1637.9652,13.4227))
        { //POLICE GATE
            if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SAST !");
            if(pdgategar==0)
            {
                pdgategar = 1;
                MoveDynamicObject(pdgaragegateobj, 1588.965698, -1637.882690, 7.710285, 1.50);
            }
            else if(pdgategar==1)
            {
                pdgategar = 0;
                MoveDynamicObject(pdgaragegateobj, 1588.965698, -1637.882690, 15.260185, 1.50);
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid,9,1544.4913,-1627.2817,13.3828))
        { //POLICE BAR
            if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SAST !");
            if(pdgatebar==0)
            {
                pdgatebar = 1;
                SetDynamicObjectRot( pdbarriergateobj, 0.0000, 360.0000, 90.0000);
                SetDynamicObjectPos( pdbarriergateobj, 1544.682495, -1630.953003, 13.079567 );
            }
            else if(pdgatebar==1)
            {
                pdgatebar = 0;
                SetDynamicObjectRot( pdbarriergateobj, 0.0000, 90.0000, 90.0000);
                SetDynamicObjectPos( pdbarriergateobj, 1544.682495, -1630.980000, 13.215000 );
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid,9,96.8500, 1923.4334, 15.3518))
        { //PRISON GATE
            if(!IsACop(playerid) && PlayerInfo[playerid][pMember] != 5) return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SASP / NG !");
            if(Prison_Buttons[GateOpened] == 0)
            {
                MoveDynamicObject(Prison_Buttons[PrisonGate], 96.808670, 1923.5, 16.234968, 1.50);
                Prison_Buttons[GateOpened] = 1;
                Prison_Buttons[GateTimerID]= SetTimer("PrisonGateCheck", 60000, 0);
            }
            else
            {
                MoveDynamicObject(Prison_Buttons[PrisonGate], 96.808670, 1920.512817, 16.234968, 1.50);
                Prison_Buttons[GateOpened] = 0;
                KillTimer(Prison_Buttons[GateTimerID]);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "   You are not near a gate !");
            return 1;
        }
        return 1;
    }
Help needed.
Reply
#2

what you need for help is not work this script? or have errors!
Reply
#3

I can't get the objects move..
Код:
The problem is that baracade won't go up and the other one is that the garage port won't go down
No errors
Reply
#4

Quote:

SetDynamicObjectRot( pdbarriergateobj, 0.0000, 90.0000, 90.0000);
SetDynamicObjectPos( pdbarriergateobj, 1544.682495, -1630.980000, 13.215000 );

Change that to this below, because to code you used rotates the object and afterwards put it in a certain position which it is supposed to move.

Quote:

else if(IsPlayerInRangeOfPoint(playerid,9,1544.4913,-1627.2817,13.382)
{ //POLICE BAR
if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_GREY," You do not have a remote to open that!");
if(pdgatebar==0)
{
pdgatebar = 1;
SetDynamicObjectRot( pdbarriergateobj, 0.0000, 360.0000, 90.0000);
MoveDynamicObject(pdbarriergateobj, 1544.682495, -1630.953003, 13.079567, 1.50 );
}
else if(pdgatebar==1)
{
pdgatebar = 0;
SetDynamicObjectRot(pdbarriergateobj, 0.0000, 90.0000, 90.0000);
MoveDynamicObject(pdbarriergateobj, 1544.682495, -1630.980000, 13.215000, 1.50 );
}
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)