saving +rep - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: saving +rep (
/showthread.php?tid=571147)
saving +rep -
iBots - 16.04.2015
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?
Re: saving +rep -
J4Rr3x - 16.04.2015
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
Re: saving +rep -
Evocator - 16.04.2015
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.