saving +rep
#1

Ey,i need a better idea,i made objects for houses to save,using dialogs and...but when i compile the .amx file gets like 3000 more kb's,i used enums for houses and another enums for objects and i was setting house id for object as the house id the it belongs to,and using it i load them and...,is there anyway by it i could save objects for houses and make it better and with less kb's?
Reply
#2

Use 'char' in array (i.e. new string[128 char]).
Reorders your code, i.e. use less bracket. Change:
pawn Код:
for(new i = 0; i != MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(playerid))
    {
        if(Player_Info[playerid][pHouse] == 1)
        {
             Player_Info[playerid][pHouse] = 0;
         }
     }    
}
with:
pawn Код:
for(new i = 0; i != MAX_PLAYERS; i++)
    if(IsPlayerConnected(playerid) && Player_Info[playerid][pHouse] == 1)
        Player_Info[playerid][pHouse] = 0;
Read tutorials about improving your code
Reply
#3

Quote:
Originally Posted by J4Rr3x
Посмотреть сообщение
(i.e. new string[128 char])
NO NO NO and NO!
Only char arrays that you are sure that its value wont drop below 0 and wont exceed 255.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)