Quote:
Originally Posted by [H]ead
They are useful.
Are not equal to global variables, because they are declared only in the current scope ..
pawn Код:
public OnPlayerSpawn(playerid) { static lastPlayerSpawn ; printf("The last player on spawn is playerid %d", lastPlayerSpawn); return lastPlayerSpawn = playerid; } // It remains the old value and unreported in other scopes (only by declaring again)
The best definition would be:
Are global variables in a single scope (not the entire code)
|
So the static is like "new" but its dont get resetted evrey time the callback is called?