SA-MP Forums Archive
amx file is way to big - 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: amx file is way to big (/showthread.php?tid=627647)



amx file is way to big - danielpalade - 30.01.2017

-- DELETED --


Re: amx file is way to big - Sew_Sumi - 30.01.2017

Over use of those variables, in-particular arrays will cause this.


Re: amx file is way to big - danielpalade - 30.01.2017

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Over use of those variables, in-particular arrays will cause this.
Ow.. I do have a variable which I use quite often. Can't I do anything to keep using that same variable?


Re: amx file is way to big - Sew_Sumi - 30.01.2017

https://sampforum.blast.hk/showthread.php?tid=177114

This is a thread that explains things a bit more. It's a common problem, but it doesn't mean you have to rip out variables, you just have to use them better and not make as big a variables.

Like when you use string, instead of making them 256, you can make them simply 144 if they are for display on the players screen.

Your arrays may have massive size, when they don't actually need to be that big.


Re: amx file is way to big - danielpalade - 30.01.2017

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
https://sampforum.blast.hk/showthread.php?tid=177114

This is a thread that explains things a bit more. It's a common problem, but it doesn't mean you have to rip out variables, you just have to use them better and not make as big a variables.

Like when you use string, instead of making them 256, you can make them simply 144 if they are for display on the players screen.

Your arrays may have massive size, when they don't actually need to be that big.
The thing is, I commented out everything that had to do with that variabile. And it didn't change anything. The size was still around 60mb.


Re: amx file is way to big - BiosMarcel - 30.01.2017

Quote:
Originally Posted by danielpalade
Посмотреть сообщение
The thing is, I commented out everything that had to do with that variabile. And it didn't change anything. The size was still around 60mb.
You know, most of the time, oversized scripts are not oversized just because of a single variable / array


Re: amx file is way to big - danielpalade - 30.01.2017

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
You know, most of the time, oversized scripts are not oversized just because of a single variable / array
Yea.. But as I said, no other variable is "big" or used often..


Re: amx file is way to big - Beckett - 30.01.2017

How do you define a "big" variable, can you provide us a sample?


Re: amx file is way to big - Nero_3D - 30.01.2017

Quote:
Originally Posted by danielpalade
Посмотреть сообщение
Yea.. But as I said, no other variable is "big" or used often..
To clarify something, only global and local static variables are saved in the amx no matter how often you used them if at least once

I would look for 2, 3 or 4 dimensional global arrays, these are especially memory hungry if wrongly dimensioned

start with redefining MAX_PLAYERS right under #include <a_samp>
PHP код:
#undef MAX_PLAYERS // by default 1000
#define MAX_PLAYERS 500 // your server size