Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Optimize my function

$
0
0
Hi!

How can I optimize this function with a loop ?

thanks

HTML Code:

Function(playerid)
{
        if(PlayerInfo[playerid][house1] == 40)
        {
                PlayerInfo[playerid][house1] = 0;
        }
        else if(PlayerInfo[playerid][house2] == 40){
                PlayerInfo[playerid][house2] = 0;
        }
        else if(PlayerInfo[playerid][house3] == 40){
                PlayerInfo[playerid][house3] = 0;
        }
        else if(PlayerInfo[playerid][house4] == 40){
                PlayerInfo[playerid][house4] = 0;
        }
        else if(PlayerInfo[playerid][house5] == 40){
                PlayerInfo[playerid][house5] = 0;
        }
        else if(PlayerInfo[playerid][house6] == 40){
                PlayerInfo[playerid][house6] = 0;
        }
        else if(PlayerInfo[playerid][house7] == 40){
                PlayerInfo[playerid][house7] = 0;
        }
        else if(PlayerInfo[playerid][house8] == 40){
                PlayerInfo[playerid][house8] = 0;
        }
        return 1;
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>