Looping in OnPlayerEnterDynamicCP!
#1

PHP код:
public OnPlayerEnterDynamicCP(playerid)
{
    if(
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        for(new 
0<= MAX_INTERIORSi++)
        {
            if(
checkpointid == InteriorCP[i])
            {
                
// CODES
            
}
        }
        for(new 
0<= MAX_INTERIORCPSi++)
        {
            if(
checkpointid == InteriorListCP[i])
            {
                
// CODES
            
}
        }
    }
    return 
1;

PHP код:
public OnPlayerEnterDynamicCP(playerid)
{
    if(
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        for(new 
0<= MAX_INTERIORCPSi++)
        {
             if(
checkpointid == InteriorListCP[i])
            {
                
//CODES
            
}
        }
        for(new 
0<= MAX_INTERIORSi++)
        {
            if(
checkpointid == InteriorCP[i])
            {
                
// CODES
            
}
        }
    }
    return 
1;

FIRST CODE: if you put the MAX_INTERIORS loop in the first, it will work but it will effect in the second loop (MAX_INTERIORCPS) and make it not work

SECOND CODE: if you switch loops which making the MAX_INTERIORCPS in the first, it will work but it will effect in the second loop which is (MAX_INTERIORS) now and make it not work.

One loop just works based on which one is in the beginning...
Is it the method of looping wrong or something else? It's really Confusing !!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)