open.mp forum
[Pawn] How to solve this !? (Difficulty: Expert) - Printable Version

+- open.mp forum (https://forum.open.mp)
+-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
+--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
+--- Thread: [Pawn] How to solve this !? (Difficulty: Expert) (/showthread.php?tid=695)



How to solve this !? (Difficulty: Expert) - mouiz - 2019-07-07

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



RE: How to solve this !? (Difficulty: Expert) - Banditul - 2019-07-07

Code:
// reset player data static const empty_player[player_data]; PlayerInfo[playerid] = empty_player;



RE: How to solve this !? (Difficulty: Expert) - mouiz - 2019-07-07

Ty Man 귪