If statement error!
#1

Long time since i scripted, WTF is wrong!?

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(event(playerid)) == 1) continue; //if playerid has event = 1 they are in the race and stuff below applies to them
            DisablePlayerCheckpoint(i);
            SetPlayerVirtualWorld(playerid, 0);
            SpawnPlayer(playerid);
            FreezePlayerForTime(playerid, 3);
            event[playerid] = 0;
        }
Reply
#2

Try changing to :
pawn Код:
if(event(i)) == 1) continue;
Or :
pawn Код:
if(event(i)) == 1)
{
    continue;
}
Reply
#3

Quote:
Originally Posted by The__
Посмотреть сообщение
Try changing to :
pawn Код:
if(event(i)) == 1) continue;
Or :
pawn Код:
if(event(i)) == 1)
{
    continue;
}
Thanks, i'm such a idiot!
Reply
#4

Helps if you show the errors.
Reply
#5

where abouts is this in your script?

Quote:

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(event[playerid] == 1) { //if playerid has event = 1 they are in the race and stuff below applies to them
DisablePlayerCheckpoint(i);
SetPlayerVirtualWorld(playerid, 0);
SpawnPlayer(playerid);
FreezePlayerForTime(playerid, 3);
event[playerid] = 0;
}
}

??
Reply
#6

You have an extra bracket in your if statement.

Код:
if(event(playerid)) == 1)
//Remove the second bracket after 'playerid'.
if(event(playerid) == 1)
You should also change all "playerid" names to "i"!
Reply
#7

Quote:
Originally Posted by linuxthefish
Посмотреть сообщение
Thanks, i'm such a idiot!
No problem, sometimes I do that problem too.
It's I'm* btw .

EDIT:
Quote:
Originally Posted by funky1234
Посмотреть сообщение
You have an extra bracket in your if statement.

Код:
if(event(playerid)) == 1)
//Remove the second bracket after 'playerid'.
if(event(playerid) == 1)
You should also change all "playerid" names to "i"!
You are wrong, It's
if(event(playerid))
The "i" is correct, told him already.
Reply
#8

Sorry for double post.
Reply
#9

Still getting a shitload of errors

Код:
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16313) : error 012: invalid function call, not a valid address
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16313) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16313) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16313) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\The Way of Life\gamemodes\WoL.pwn(16313) : fatal error 107: too many error messages on one line
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(event(i) == 1) //if playerid has event = 1 they are in the race and stuff below applies to them
            {
                DisablePlayerCheckpoint(i);
                SetPlayerVirtualWorld(i, 0);
                SpawnPlayer(i);
                FreezePlayerForTime(i, 3);
                event[i] = 0;
            }
            else return 1;
        }
Reply
#10

Quote:
Originally Posted by The__
Посмотреть сообщение
No problem, sometimes I do that problem too.
It's I'm* btw .

EDIT:

You are wrong, It's
if(event(playerid))
The "i" is correct, told him already.
if(event(playerid)) == 1)
isn't green the extra bracket?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)