Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <YSI_Storage\y_ini>
- #include <YSI_Coding\y_hooks>
- #define MAX_ORGANIZATIONS 50
- #define ACCOUNT_path "/Accounts/%s.ini"
- #define ORGANIZATION_path "/Organizations/%i.ini"
- enum PLAYER_Info {
- PLAYER_Password,
- PLAYER_Sex,
- PLAYER_Age,
- PLAYER_Country,
- PLAYER_Money,
- PLAYER_Bank,
- PLAYER_Skin,
- PLAYER_Admin
- };
- new PlayerInfo[MAX_PLAYERS][PLAYER_Info];
- forward LoadUser_data(playerid, name[], value[]);
- hook OnGameModeInit() {
- new h, m, s;
- gettime( h, m, s );
- printf("[ %02d:%02d:%02d ] YT_Enums skripta ucitana!", h, m, s);
- return 1;
- }
- stock SaveUser(playerid) {
- new INI:File = INI_Open(AccountPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteInt(File, "PLAYER_Sex", PlayerInfo[playerid][PLAYER_Sex]);
- INI_WriteInt(File, "PLAYER_Age", PlayerInfo[playerid][PLAYER_Age]);
- INI_WriteInt(File, "PLAYER_Country", PlayerInfo[playerid][PLAYER_Country]);
- INI_WriteInt(File, "PLAYER_Money", PlayerInfo[playerid][PLAYER_Money]);
- INI_WriteInt(File, "PLAYER_Bank", PlayerInfo[playerid][PLAYER_Bank]);
- INI_WriteInt(File, "PLAYER_Skin", PlayerInfo[playerid][PLAYER_Skin]);
- INI_WriteInt(File, "PLAYER_Admin", PlayerInfo[playerid][PLAYER_Admin]);
- INI_Close(File);
- return 1;
- }
- public LoadUser_data(playerid, name[], value[]) {
- INI_Int("PLAYER_Password", PlayerInfo[playerid][PLAYER_Password]);
- INI_Int("PLAYER_Sex", PlayerInfo[playerid][PLAYER_Sex]);
- INI_Int("PLAYER_Age", PlayerInfo[playerid][PLAYER_Age]);
- INI_Int("PLAYER_Country", PlayerInfo[playerid][PLAYER_Country]);
- INI_Int("PLAYER_Money", PlayerInfo[playerid][PLAYER_Money]);
- INI_Int("PLAYER_Bank", PlayerInfo[playerid][PLAYER_Bank]);
- INI_Int("PLAYER_Skin", PlayerInfo[playerid][PLAYER_Skin]);
- INI_Int("PLAYER_Admin", PlayerInfo[playerid][PLAYER_Admin]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment