Need explaination!!
#1

Hey guys could someone explain me what actually this thing do??

pawn Код:
static bool:varaible;
Reply
#2

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
Reply
#3

A bit more clear please??How actually it works?
Reply
#4

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);
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)