SA-MP Forums Archive
#pragma dynamic in 0.3z - 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: #pragma dynamic in 0.3z (/showthread.php?tid=488967)



#pragma dynamic in 0.3z - Grimrandomer - 19.01.2014

Hi there,

Not sure if this is the right section, so please move this post if its wrong.


Basically, in my 0.3x Script, I increased the memory cells for the stack using "#pragma dynamic 8192" effectivly doubling it, but when I compile the script in 0.3z the memory warnings re-appear.

Has #pragma dynamic been removed / renamed in 0.3z?


Thanks for any help,

Grim.


Re: #pragma dynamic in 0.3z - CyNiC - 19.01.2014

The server includes are a bit larger with the new natives, it makes your script have more stack, keep increasing.


Re: #pragma dynamic in 0.3z - Mauzen - 20.01.2014

Thats about the compiler. And the pawn compiler for samp hasnt been updated for years.


Re: #pragma dynamic in 0.3z - Grimrandomer - 20.01.2014

Since found the issue, In my old a_samp include, i had re-defined MAX_PLAYERS to 32, and when i copied the 0.3z a_samp it was back at 500

Thanks for the help tho guys


Re: #pragma dynamic in 0.3z - LegalGame - 21.01.2014

see you pawn.cfg


Re: #pragma dynamic in 0.3z - MP2 - 21.01.2014

Quote:
Originally Posted by Grimrandomer
Посмотреть сообщение
Since found the issue, In my old a_samp include, i had re-defined MAX_PLAYERS to 32, and when i copied the 0.3z a_samp it was back at 500

Thanks for the help tho guys
So you don't have this issue again in the future, you should never edit includes, as your changes will be lost. Do this:

pawn Код:
#include <a_samp>
#undef MAX_PLAYERS
#define MAX_PLAYERS 32



Re: #pragma dynamic in 0.3z - Luis- - 21.01.2014

What's the use of doing the above code? Couldn't you just edit it via server.cfg?


Re: #pragma dynamic in 0.3z - Riddick94 - 21.01.2014

Quote:
Originally Posted by Luis-
Посмотреть сообщение
What's the use of doing the above code? Couldn't you just edit it via server.cfg?
MAX_PLAYERS is the value from a_samp.inc file, which is located in yout pawno/include folder. MAX_PLAYERS value is mostly used to loop through all the players (max players of SA-MP that can handle) which is: 500 (or 1000 in Linux). Instead of doing loop this way, I rather using foreach created by ******.


Re: #pragma dynamic in 0.3z - Babul - 22.01.2014

just in case you want to prevent the warning when compiling other scripts which dont include yout MAX_PLAYERS re-definition:
add
Код:
-S8192
in your compiler run options.


Re: #pragma dynamic in 0.3z - Luis- - 22.01.2014

Ah, didn't think of that. Thanks for explaining.