Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************
- ** **
- ** m_Saving System **
- ** **
- *************************/
- #include <a_samp>
- #include <dINI>
- #pragma unused strtok
- #pragma tabsize 0
- new mname[MAX_PLAYER_NAME];
- new Datoteka[128];
- public OnFilterScriptInit() {
- printf("========================");
- printf(" m_Saving System Loaded ");
- printf("========================");
- return true; }
- public OnPlayerConnect(playerid)
- {
- GetPlayerName(playerid, mname, sizeof(mname));
- format(Datoteka, sizeof(Datoteka),"/mKorisnici/%s.ini",mname);
- if(dini_Exists(Datoteka))
- {
- SetPlayerMoney(playerid, dini_Int(Datoteka, "Novac"));
- SetPlayerScore(playerid, dini_Int(Datoteka, "Bodovi/Score"));
- } else {
- dini_Create(Datoteka);
- dini_IntSet(Datoteka, "Novac", 500);
- dini_IntSet(Datoteka, "Bodovi/Score", 0);
- SetPlayerMoney(playerid, dini_Int(Datoteka, "Novac"));
- SetPlayerScore(playerid, dini_Int(Datoteka, "Bodovi/Score"));
- }
- return true;
- }
- public OnPlayerDisconnect(playerid)
- {
- if(dini_Exists(Datoteka))
- {
- dini_IntSet(Datoteka, "Novac", GetPlayerMoney(playerid));
- dini_IntSet(Datoteka, "Bodovi/Score", GetPlayerScore(playerid));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement