what ive done wrong?
#1

what have i done wrong here?
pawn Код:
CMD:robsex(playerid, params[])
{
        if(IsPlayerInRangeOfPoint(playerid, 1.0, -107.1983,-8.3455,1000.7188))
        SetTimer("rob", 10000, false);
        SendClientMessage(playerid, -1, "stay in the checkpoint for 30 secs to rob it!");
        return 1;
    {
    else
    }
        SendClientMessage(playerid, -1, "your not in checkpoint!");
        return 0;
}
    return 1;
}

C:\Users\iphone\Desktop\SFCNR coding\filterscripts\Car_System.pwn(4 : warning 225: unreachable code
C:\Users\iphone\Desktop\SFCNR coding\filterscripts\Car_System.pwn(4 : warning 217: loose indentation
C:\Users\iphone\Desktop\SFCNR coding\filterscripts\Car_System.pwn(49) : error 029: invalid expression, assumed zero
C:\Users\iphone\Desktop\SFCNR coding\filterscripts\Car_System.pwn(51) : warning 217: loose indentation
C:\Users\iphone\Desktop\SFCNR coding\filterscripts\Car_System.pwn(54) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

pawn Код:
CMD:robsex(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 1.0, -107.1983,-8.3455,1000.7188))
    {
        SetTimer("rob", 10000, false);
        SendClientMessage(playerid, -1, "stay in the checkpoint for 30 secs to rob it!");
        return 1;
    {
    else
    }
        SendClientMessage(playerid, -1, "your not in checkpoint!");
        return 0;
    }
    return 1;
}
you missed the opening bracket in your if statement

indenting the code properly helps to identify this right away
Reply
#3

thanks, but got this


C:\Users\iphone\Desktop\SFCNR coding\filterscripts\Car_System.pwn(49) : warning 225: unreachable code
C:\Users\iphone\Desktop\SFCNR coding\filterscripts\Car_System.pwn(49) : warning 217: loose indentation
C:\Users\iphone\Desktop\SFCNR coding\filterscripts\Car_System.pwn(50) : error 029: invalid expression, assumed zero
C:\Users\iphone\Desktop\SFCNR coding\filterscripts\Car_System.pwn(52) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Код:
CMD:robsex(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 1.0, -107.1983,-8.3455,1000.7188))
    {
        SetTimer("rob", 10000, false);
        SendClientMessage(playerid, -1, "stay in the checkpoint for 30 secs to rob it!");
        return 1;
    }
    else
    {
        SendClientMessage(playerid, -1, "your not in checkpoint!");
        return 0;
    }
    return 1;
}
Try this
Reply
#5

Also,
pawn Код:
#pragma tabsize 0
Will stop all those "Loose Indentations" warnings .
Reply
#6

if that did not work
show what line is 49
and show the code above this line 49.
Reply
#7

Quote:
Originally Posted by Windows32
Посмотреть сообщение
Also,
pawn Код:
#pragma tabsize 0
Will stop all those "Loose Indentations" warnings .
So does intending properly. Had the OP done that to begin with...it would be easier for him to sort out his bracket problem...
Reply
#8

its good so far, the cmd works but.. when it sends you are not in checkpoint there is SERVER:Unkown cmd
Reply
#9

If you don't want the "unknown command" error return 1 instead of 0.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)