16.06.2012, 08:20
https://sampforum.blast.hk/showthread.php?tid=128073
Can someone add an stats saving system using dini?
Score - Score count when you kill player
/stats - Show your stats (Kills,Death)
P.S > THIS IS THE LAST AND FINAL STEP OF MY GAMEMODE. Hopefully someone can help me..
Код:
C(register) { new pass[128]; GetPlayerName(playerid, pname, sizeof(pname)); format(str, sizeof(str), "%s.user", pname); if(dini_Exists(str)) return SCM(playerid, red, "ERROR: This nickname is already registered. Please reconnect with another nickname."); else if(strlen(params) < 5) return SCM(playerid, red, "ERROR: Your password must be at least 5 characters long!"); else if(sscanf(params, "s[128]", pass)) return SCM(playerid, yellow, "Usage: /register <password>"); WP_Hash(buf, sizeof(buf), pass); dini_Create(str); dini_IntSet(str, "registered", 1); dini_IntSet(str, "level", 0); dini_IntSet(str, "muted", PData[playerid][Muted]); dini_IntSet(str, "jailed", PData[playerid][Jailed]); dini_Set(str, "password", buf); format(str2, sizeof(str2), "You have successfully registered your nickname with the password \"%s\" - please write it down incase you forget it.", pass); SCM(playerid, green, str2); SCM(playerid, green, "Your password is saved hashed and even admins cannot see it. You have also been automatically logged in! "); PData[playerid][Loggedin] = 1; PData[playerid][Registered] = 1; dini_Set(str, "lastip", pip); return 1; }
Score - Score count when you kill player
/stats - Show your stats (Kills,Death)
P.S > THIS IS THE LAST AND FINAL STEP OF MY GAMEMODE. Hopefully someone can help me..