SA-MP Forums Archive
Why do these not work? - 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: Why do these not work? (/showthread.php?tid=338055)



Why do these not work? - BleverCastard - 28.04.2012

pawn Код:
CMD:dooropen(playerid, params[])
{
    if(playerVariables[playerid][pGroup] == 1)
    {
            if(IsPlayerInRangeOfPoint(playerid, 2.0, 1812.0830,-1545.2319,5700.4287))
            {

                MoveObject(pdoor3,1811.73828125+1,-1545.82873535,5699.42480469,0.50);
                MoveObject(pdoor4,1808.73071289-1,-1545.87463379,5699.42480469,0.50);
                return 1;
            }
            else if(IsPlayerInRangeOfPoint(playerid, 2.0,1797.00830078,-1525.15258789,5699.42480469) || IsPlayerInRangeOfPoint(playerid, 2.0, 1793.6631,-1523.9191,5700.4287))
            {
                MoveObject(edoor5,1797.00830078+1,-1525.15258789,5699.42480469,0.50);
                MoveObject(edoor6,1794.00976562-1,-1525.18676758,5699.42480469,0.50);
                return 1;
            }
            else SendClientMessage(playerid, 0xAA3333AA, "[Error]: {FFFFFF} You are not around a control pad!");
            return 1;
    }
    else return SendClientMessage(playerid,-1, "You are not a Prison Guard!");
}
pawn Код:
CMD:doorclose(playerid, params[])
{
    if(playerVariables[playerid][pGroup] == 1)
    {
            if(IsPlayerInRangeOfPoint(playerid, 2.0, 1812.0830,-1545.2319,5700.4287))
            {

                MoveObject(pdoor3,1811.73828125,-1545.82873535,5699.42480469,0.50);
                MoveObject(pdoor4,1808.73071289,-1545.87463379,5699.42480469,0.50);
                return 1;
            }
            else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1797.00830078,-1525.15258789,5699.42480469) || IsPlayerInRangeOfPoint(playerid, 2.0, 1793.6631,-1523.9191,5700.4287))
            {
                MoveObject(edoor5,1797.00830078,-1525.15258789,5699.42480469,0.50);
                MoveObject(edoor6,1794.00976562,-1525.18676758,5699.42480469,0.50);
                return 1;
            }
            else SendClientMessage(playerid, 0xAA3333AA, "[Error]: {FFFFFF} You are not around a control pad!");
            return 1;
    }
    else return SendClientMessage(playerid,-1, "You are not a prison guard!");
}
If I'm not a prison guard and I type them near a Control pad it opens, why?!


Re: Why do these not work? - ReneG - 28.04.2012

Try resetting every variable to zero (like team variable) OnPlayerConnect.


Re: Why do these not work? - BleverCastard - 28.04.2012

They are, I'm using AF-RP.