25.03.2010, 03:50
Good camera and vehicles stuff. Thanks.
Good thing for flags is char operator. Creating:
and usage example
i think PVar is not necessary
Quote:
Per-player variable system: (PVars). Originally SA-MP was only designed for 100 maximum players. This meant defining arrays in pawn of MAX_PLAYERS size such as: PlayerInfo[MAX_PLAYERS] was generally okay. Now that MAX_PLAYERS is defined as 500, script writers are finding themselves creating arrays with 500 elements just to store a single flag. This can turn out to be very wasteful in terms of memory use. These variables also need to be manually reset when the player using them leaves the server. |
Code:
// creating a packed string or array with 125 cells and 500 1-byte elements new PlayerInfo[MAX_PLAYERS char];
Code:
PlayerInfo{playerid} = 0; PlayerInfo{456} = 100; PlayerInfo[0] = 65530; // now PlayerInfo{0} is 255, PlayerInfo{1} is 250