Need explaination!! - 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: Need explaination!! (
/showthread.php?tid=431946)
Need explaination!! -
Gamer_007 - 20.04.2013
Hey guys could someone explain me what actually this thing do??
Re: Need explaination!! -
MattyG - 20.04.2013
Global static variables are like normal globals but can only be used in the file in which they are declared
https://sampwiki.blast.hk/wiki/Scripting...#global_static
Re: Need explaination!! -
Gamer_007 - 20.04.2013
A bit more clear please??How actually it works?
Re: Need explaination!! -
MattyG - 20.04.2013
Taken directly from the wiki:
Quote:
File1:
pawn Код:
static gsMyVar = 4; MyFunc() { printf("%d", gsMyVar); } #include "File2"
File2:
pawn Код:
MyFunc2() { // This is wrong as gsMyVar doesn't exist here printf("%d", gsMyVar); }
|