Rotating objects, error
#1

I get these errors with the code below.
pawn Код:
C:\Users\PC\Downloads\samp03x_svr_R1-2_win32\pawno\map.pwn(124) : error 029: invalid expression, assumed zero
C:\Users\PC\Downloads\samp03x_svr_R1-2_win32\pawno\map.pwn(129) : error 029: invalid expression, assumed zero


pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/door", cmdtext, true, 10) == 0)
    {
        if (IsPlayerInRangeOfPoint(playerid,2,1435.58, 1532.59, 9.96))
        {
            new Float:RotX, Float:RotY, Float:RotZ;
            GetObjectRot(door1,RotX,RotY,RotZ);
            if RotZ == 90
            { //First error here.
                SetObjectRot(door1,RotX,RotY,0);
                return 1;
            }
            else if RotZ == 0
            { // Second here.
                SetObjectRot(door1,RotX,RotY,90);
                return 1;
            }
        }
        return 1;
    }
    return 0;
}
Reply
#2

if RotZ == 90
->
if(RotZ == 90)

else if RotZ == 0
->
else if(RotZ == 0)

Missing parenthesis ().
Reply
#3

Yes, of course! Thank you so much.
Reply
#4

No problem. Sometimes these things are hard to spot!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)