SA-MP Forums Archive
What's wrong with this CMD ? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What's wrong with this CMD ? (/showthread.php?tid=277676)



What's wrong with this CMD ? - -CaRRoT - 18.08.2011

Well.. I Made that /gate CMD for LSPD.. FBI..SS..Etc. , Anyway when i go to the gate it tell me you not near a gate and it don't open , even i am in it's location excatly , here is the CMD :



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 / SASP !");
            if(pdgategar==0)
            {
                pdgategar = 1;
                MoveObject(pdgaragegateobj, 1588.965698, -1637.882690, 7.710285, 1.50);
            }
            else if(pdgategar==1)
            {
                pdgategar = 0;
                MoveObject(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 / SASP !");
            if(pdgatebar==0)
            {
                pdgatebar = 1;
                SetObjectRot( pdbarriergateobj, 0.0000, 360.0000, 90.0000);
                SetObjectPos( pdbarriergateobj, 1544.682495, -1630.953003, 13.079567 );
            }
            else if(pdgatebar==1)
            {
                pdgatebar = 0;
                SetObjectRot( pdbarriergateobj, 0.0000, 90.0000, 90.0000);
                SetObjectPos( 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)
            {
                MoveObject(Prison_Buttons[PrisonGate], 96.808670, 1923.5, 16.234968, 1.50);
                Prison_Buttons[GateOpened] = 1;
                Prison_Buttons[GateTimerID]= SetTimer("PrisonGateCheck", 60000, 0);
            }
            else
            {
                MoveObject(Prison_Buttons[PrisonGate], 96.808670, 1920.512817, 16.234968, 1.50);
                Prison_Buttons[GateOpened] = 0;
                KillTimer(Prison_Buttons[GateTimerID]);
            }
        }
        else if(IsPlayerInRangeOfPoint(playerid, 12.0, -80.057670593262, -352.7497253418, 3.2030787467957))
        { //Secret Service GATE
            if(!(PlayerInfo[playerid][pMember] == 7)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of the Secret Society !");
            if(ssgateopen == 0)
            {
                ssgateopen = 1;
                MoveObject(ssgate, -80.057670593262, -352.7497253418, 7.6630787467957, 1.500000);
            }
            else
            {
                ssgateopen = 0;
                MoveObject(ssgate, -80.057670593262, -352.7497253418, 3.2030787467957, 1.500000);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "   You are not near a gate !");
            return 1;
        }
        return 1;
    }
        if(IsPlayerInRangeOfPoint(playerid,9,1642.9678,-1714.9400,15.6028))
        { //FBI GATE
            if(!(PlayerInfo[playerid][pMember] == 2)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a member of FBI !");
            if(fbigateopen == 0)
            {
                fbigateopen = 1;
                MoveObject(FBIGate, 1643.4106, -1714.7389, 15.6083, 1.500000);
                SendClientMessage(playerid, COLOR_RED, "FBI Gate is closing...");
            }
            else
            {
                fbigateopen = 0;
                MoveObject(FBIGate, 1643.4106, -1714.7389, 9.6083, 1.500000);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "FBI Gate is opening...");
            }
        }
Any Solutions ?


Re: What's wrong with this CMD ? - ElieJabbour - 18.08.2011

Use it this way

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 9, 1588.3058, -1637.9652, 13.4227))
If it didn't work try replacing the 9 in the first with an 8.0


Re: What's wrong with this CMD ? - -CaRRoT - 18.08.2011

Tried it , not working..