17.01.2010, 21:16
i use this to save my players score make a fs with this
one more thing you will need to do is make a file on your scriptfiles with the name XtreaMeR Saver
i hope help you!
Код:
#include <a_samp> #include <Dini> #include <Dutils> #include <Dudb> #define COLOR_GREY 0xCECECEFF //*******************************PRAGMAS**************************************// #pragma unused ret_memcpy #pragma tabsize 0 //Fixes all lose indentation errors //**FORWARDS**// forward XtR_OnPlayerDisconnect(playerid); forward XtR_OnPlayerConnect(playerid); //**************************************NEWS**********************************// new pname[MAX_PLAYER_NAME]; new XtreaMeRScore[100]; //------------------------------------------------------------------------------ /*---------------------------------CallBacks----------------------------------*/ public XtR_OnPlayerDisconnect(playerid){ GetPlayerName(playerid, pname, sizeof(pname)); format(XtreaMeRScore, sizeof(XtreaMeRScore), "/XtreaMeR Saver/%s.ini",pname); if(!dini_Exists(XtreaMeRScore)) { } else { dini_IntSet(XtreaMeRScore, "Score", GetPlayerScore(playerid)); } } public XtR_OnPlayerConnect(playerid){ GetPlayerName(playerid, pname, sizeof(pname)); format(XtreaMeRScore, sizeof(XtreaMeRScore), "/XtreaMeR Saver/%s.ini",pname); if(!dini_Exists(XtreaMeRScore)) { dini_Create(XtreaMeRScore); dini_IntSet(XtreaMeRScore, "Score", 0); SetPlayerScore(playerid, dini_Int(XtreaMeRScore, "Score")); } else { SetPlayerScore(playerid, dini_Int(XtreaMeRScore, "Score")); } return 1; } public OnPlayerConnect(playerid) { XtR_OnPlayerConnect(playerid); return 1; } public OnPlayerDisconnect(playerid) { XtR_OnPlayerDisconnect(playerid); return 1; }
i hope help you!