Commands returning errors (tried to fix, can't)
#1

This command;

pawn Код:
command(gate, playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 25.0, 1531.2126,-1603.6033,13.3828))
    {
        else if(IsPlayerInRangeOfPoint(playerid, 25.0, 1530.3551,-1722.2714,13.3828))
        {
            if(Player[playerid][Faction] == 1)
            {
                if(GateOpen == 0)
                {
                    MoveDynamicObject(PDGate1, 1534.39, -1602.27, 13.27, 2.0, 0.0, 0.0, 89.94);
                    MoveDynamicObject(PDGate2, 1534.60, -1724.10, 13.35, 2.0, 0.0, 0.0, 0.0);
                    GateOpen = 1;
                }
                else
                {
                    MoveDynamicObject(PDGate1, 1534.39, -1602.27, 13.27, 2.0, -90.60, 360.06, 89.94);
                    MoveDynamicObject(PDGate2, 1534.40,-1724.08,13.35, 2.0, 0.0, 0.0, 0.0);
                    GateOpen = 0;
                }
            }
        }
    }
    return 1;
}
Returns the following errors;

Quote:

C:\Users\owner\Desktop\SCRP\Server Files\gamemodes\SCRP.pwn(2743) : error 029: invalid expression, assumed zero
C:\Users\owner\Desktop\SCRP\Server Files\gamemodes\SCRP.pwn(2743) : warning 215: expression has no effect
C:\Users\owner\Desktop\SCRP\Server Files\gamemodes\SCRP.pwn(2743) : error 001: expected token: ";", but found "if"

For this line;

pawn Код:
else if(IsPlayerInRangeOfPoint(playerid, 25.0, 1530.3551,-1722.2714,13.3828))
Reply
#2

you are doing a else if statement inside a if statement, just remove the else, so it looks like this:
pawn Код:
else if(IsPlayerInRangeOfPoint(playerid, 25.0, 1530.3551,-1722.2714,13.3828))
Reply
#3

+rep, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)