SA-MP Forums Archive
(Somewhat) Advanced Scripting Question - 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: (Somewhat) Advanced Scripting Question (/showthread.php?tid=439901)



(Somewhat) Advanced Scripting Question - TKZ227 - 27.05.2013

I'm reading pawn_lang and I'm currently learning about constants (and other types of data declarations). It says that a constant can be used when you want a variable that should only be set by the "host application". What would be the "host application" in terms of scripting for SA-MP? When should I use a constant in the case of SA-MP?


Re: (Somewhat) Advanced Scripting Question - Scenario - 27.05.2013

http://dictionary.reference.com/browse/constant?s=t

Quote:

not changing or varying;

You would use const when you know something isn't going to be changing at all.


Re: (Somewhat) Advanced Scripting Question - TKZ227 - 27.05.2013

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
http://dictionary.reference.com/browse/constant?s=t



You would use const when you know something isn't going to be changing at all.
I've gotten that much of course, but I'm more focused on what can change a constant. pawn_lang states that the host application can change it - so what would the host application be in terms of scripting for SA-MP (if there is one)?


Re: (Somewhat) Advanced Scripting Question - Vince - 27.05.2013

Constants can't be modified once set. In a way they simply act like a macro. But you can also make a constant array of coordinates which can then be compiled a bit more efficiently.