• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] How to solve this !? (Difficulty: Expert)
#1
I want to clear all the elements of an enumerator in an automatic manner using a stock so i won't need to update this stock everytime i add a new variable/element to the enum. But there is a problem, it works only if there are integer variables in the enum.?How can i make it work which?arrays and integers both :



Code:
enum player_data

{

? ? password [26],



? ? player_mode,



? ? spawned,



? ? kills,

? ? deaths

};





stock ClearPlayerData (playerid)

{

? ??for (new i = 0; i < sizeof (PlayerInfo []); i)

? ? {

? ? ? ? PlayerInfo [playerid][player_data : i] = 0;

? ? }

? ? return 1;

}
  Reply
#2
Code:
// reset player data

static const empty_player[player_data];

PlayerInfo[playerid] = empty_player;
Away
  Reply
#3
Ty Man 귪
  Reply


Forum Jump: