Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <YSI\y_ini>
- #define SaveDest "Reputation/%s.ini"
- enum PlayerInfo
- {
- Reputation,
- }
- new pInfo[MAX_PLAYERS][PlayerInfo];
- forward LoadRep(playerid,name[],value[]);
- public LoadRep(playerid,name[],value[])
- {
- INI_Int("Reputation", pInfo[playerid][Reputation]);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- INI_ParseFile(UserPath(playerid),"LoadRep",.bExtra = true, .extra = playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File, "Reputation", pInfo[playerid][Reputation]);
- INI_Close(File);
- return 1;
- }
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),SaveDest,playername);
- return string;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement