Guest User

Enums

a guest
May 16th, 2022
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.79 KB | None | 0 0
  1. #include <a_samp>
  2. #include <YSI_Storage\y_ini>
  3. #include <YSI_Coding\y_hooks>
  4.  
  5. #define MAX_ORGANIZATIONS       50
  6.  
  7. #define ACCOUNT_path            "/Accounts/%s.ini"
  8. #define ORGANIZATION_path       "/Organizations/%i.ini"
  9.  
  10. enum PLAYER_Info {
  11.     PLAYER_Password,
  12.     PLAYER_Sex,
  13.     PLAYER_Age,
  14.     PLAYER_Country,
  15.     PLAYER_Money,
  16.     PLAYER_Bank,
  17.     PLAYER_Skin,
  18.     PLAYER_Admin
  19. };
  20.  
  21. new PlayerInfo[MAX_PLAYERS][PLAYER_Info];
  22.  
  23. forward LoadUser_data(playerid, name[], value[]);
  24.  
  25. hook OnGameModeInit()   {
  26.     new h, m, s;
  27.     gettime( h, m, s );
  28.     printf("[ %02d:%02d:%02d ] YT_Enums skripta ucitana!", h, m, s);
  29.     return 1;
  30. }
  31.  
  32. stock SaveUser(playerid)    {
  33.     new INI:File = INI_Open(AccountPath(playerid));
  34.     INI_SetTag(File, "data");
  35.     INI_WriteInt(File, "PLAYER_Sex", PlayerInfo[playerid][PLAYER_Sex]);
  36.     INI_WriteInt(File, "PLAYER_Age", PlayerInfo[playerid][PLAYER_Age]);
  37.     INI_WriteInt(File, "PLAYER_Country", PlayerInfo[playerid][PLAYER_Country]);
  38.     INI_WriteInt(File, "PLAYER_Money", PlayerInfo[playerid][PLAYER_Money]);
  39.     INI_WriteInt(File, "PLAYER_Bank", PlayerInfo[playerid][PLAYER_Bank]);
  40.     INI_WriteInt(File, "PLAYER_Skin", PlayerInfo[playerid][PLAYER_Skin]);
  41.     INI_WriteInt(File, "PLAYER_Admin", PlayerInfo[playerid][PLAYER_Admin]);
  42.     INI_Close(File);
  43.     return 1;
  44. }
  45.  
  46. public LoadUser_data(playerid, name[], value[]) {
  47.     INI_Int("PLAYER_Password", PlayerInfo[playerid][PLAYER_Password]);
  48.     INI_Int("PLAYER_Sex", PlayerInfo[playerid][PLAYER_Sex]);
  49.     INI_Int("PLAYER_Age", PlayerInfo[playerid][PLAYER_Age]);
  50.     INI_Int("PLAYER_Country", PlayerInfo[playerid][PLAYER_Country]);
  51.     INI_Int("PLAYER_Money", PlayerInfo[playerid][PLAYER_Money]);
  52.     INI_Int("PLAYER_Bank", PlayerInfo[playerid][PLAYER_Bank]);
  53.     INI_Int("PLAYER_Skin", PlayerInfo[playerid][PLAYER_Skin]);
  54.     INI_Int("PLAYER_Admin", PlayerInfo[playerid][PLAYER_Admin]);
  55.     return 1;
  56. }
  57.  
Advertisement
Add Comment
Please, Sign In to add comment