Optimize my function
#5

If "house1, house2, house3, etc." is a factor or a enumerator and the first factor starts at index 0 (modify the loop's initial and final value if it does not start at index 0), you can do:
pawn Код:
for(new i = 0; i < 8; i ++)
{
    if(PlayerInfo[playerid][nameOfEnumerator:i] == 40)
    {
        PlayerInfo[playerid][nameOfEnumerator:i] = 0;
    }
}
Please note that you must change "nameOfEnumerator" to the correspondent name of your enumerator.
Reply


Messages In This Thread
Optimize my function - by pelican1 - 19.05.2017, 15:54
Re: Optimize my function - by rolex - 19.05.2017, 16:00
Re: Optimize my function - by Pottus - 19.05.2017, 16:00
Re: Optimize my function - by rolex - 19.05.2017, 16:05
Re: Optimize my function - by CheezIt - 19.05.2017, 17:32

Forum Jump:


Users browsing this thread: 1 Guest(s)