Question about this loop
#1

Hello guys I have a question, is this loop same like the down one?

pawn Код:
new x=0;
    while(x != MAX_PLAYERS)
    {
        if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE)
        {
            SetPlayerTime(x, hours, minutes);
        }
    x++;
    }
to
pawn Код:
for (new x = 0; x<MAX_PLAYERS; x++)
{
    if (IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) //but i dunno if here is != PLAYER_STATE_NONE or ==
    {
        SetPlayerTime(x, hours, minutes);
    }
}
Thanks guys!
Reply
#2

yes...
Reply
#3

yeah mate and here should be in the for (new...) way
if (IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE)

!= PLAYER_STATE_NONE)
or this == PLAYER_STATE_NONE)
Reply
#4

It's up to your choice , if you want if his state equal to NON then use '==' equal too if you want to continue saving his time if the player state not equal NONE use '!=' Not equal.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)