07.09.2011, 18:54
Quote:
So the keyword static is pointless in pawn?
I may as well use global variables, or is the point of it to keep scripts ordered nicely, without having a huge list of global declarations at the top of the script? |
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)
Are global variables in a single scope (not the entire code)