I need help with checkpoints..(i will +REP)
#3

A script only ends if it encounters a) the closing brace at the end of the function or b) a return statement. You set CheckPoint[playerid] to 2. But the script doesn't end there. The following if-statments checks if CheckPoint[playerid] is equal to 2. It is, because you just set it to 2 yourself. So that block is executed as well. This continues down the chain.

I recommend using a switch statement (easy) or an array of coordinates (slightly more difficult, but easier to maintain).

pawn Код:
switch(CheckPoint[playerid])
{
    case 1: {}
    case 2: {}
    case 3: {}
    // ...
}
Reply


Messages In This Thread
I need help with checkpoints..(i will +REP) - by sansk - 13.09.2013, 22:41
Re: I need help with checkpoints..(i will +REP) - by sansk - 13.09.2013, 22:44
Re: I need help with checkpoints..(i will +REP) - by Vince - 13.09.2013, 22:53

Forum Jump:


Users browsing this thread: 1 Guest(s)