Why do these not work?
#1

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!");
    }
    else return SendClientMessage(playerid,-1, "You are not a Prison Guard!");
    return 1;
}
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!");
    }
    else return SendClientMessage(playerid,-1, "You are not a prison guard!");
    return 1;
}
If you are not pGroup1 you can still do it.
Reply
#2

Try this hope this works and it is untested:
pawn Код:
CMD:dooropen(playerid, params[])
{
    if(playerVariables[playerid][pGroup] != 1)
    {
        return SendClientMessage(playerid,-1, "You are not a Prison Guard!");
    }
    else
    {
                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;
}

CMD:doorclose(playerid, params[])
{
    if(playerVariables[playerid][pGroup] != 1)
    {
        return SendClientMessage(playerid,-1, "You are not a prison guard!");
    }
    else
    {
                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;
}
Reply
#3

If you can still do it, it means you're setting the pGroup to 1 somewhere else in the script.
Reply
#4

Urgh, It keeps saying GeoIP_Plugin isn't loading and I got the latest one, help?!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)