How to optimize this!
#7

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Код:
CMD:furniture(playerid, params[])
{
	static houseid = -1, muebles[MAX_HOUSE_FURNITURE];
	new count;
    if((houseid = House_Inside(playerid)) != -1 && House_IsOwner(playerid, houseid))
    {
        for(new i = 0,j = MAX_FURNITURE;i <= j;i++)
        {
            if(count < MAX_HOUSE_FURNITURE && FurnitureData[i][furnitureExists] && FurnitureData[i][furnitureHouse] == houseid) 
				ListedFurniture[playerid][count++] = i,
                muebles[i] = FurnitureData[i][furnitureModel];
        }
        if(count) ShowModelSelectionMenu(playerid, "Muebles", MODEL_SELECTION_MUEBLES, muebles, sizeof(muebles), -16.0, 0.0, -55.0, 0.9, 1);
        else SendErrorMessage(playerid, "esta casa no tiene muebles.");
    }
    else SendErrorMessage(playerid, "no estбs en el interior de tu casa.");
    return 1;
}
You even made it worse with putting the "new count;" out of the first if block ^^ and still this isnt optimizing it is just dirty coding ffs
The lifetime of a variable should be as small as possible
Reply


Messages In This Thread
How to optimize this! - by StreK - 13.05.2016, 22:24
Re: How to optimize this! - by Micko123 - 14.05.2016, 05:47
Re: How to optimize this! - by BiosMarcel - 14.05.2016, 09:07
Re: How to optimize this! - by Micko123 - 14.05.2016, 10:15
Re: How to optimize this! - by BiosMarcel - 14.05.2016, 10:29
Re: How to optimize this! - by F1N4L - 14.05.2016, 12:22
Re: How to optimize this! - by BiosMarcel - 14.05.2016, 12:25

Forum Jump:


Users browsing this thread: 1 Guest(s)