Problema con guardado de score,dinero,kills
#1

Puse este comando pero no guarda el score si se desconectan,tambien le puse uno de dinero y ya tiene lo de kill deaths.


Код:
CMD:setscore(playerid, params[]) {
	new id; // "defines" the targets id.
	new score; // Gets the targets score ( was added to prevent an error.)
	new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
	GetPlayerName(playerid, name, sizeof(name));
	if(Player[playerid][Level] < 5 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{0099FF}>> {EEEEEE}Error: {0099FF}You Need To Be A Higher Admin Level.");
	if(sscanf(params, "ui", id, score)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /setscore [ID] [SCORE]"); //If there aren't enough params typed in(ex - /setscore ID)
	if(score < 1) return SendClientMessage(playerid, 0xFF0000AA, "You need to give more than 1 score."); //This isn't really needed, but it "forces" the admin to give the player more than 1 score.
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000AA, "Target is not online."); //If the targets id isn't "valid", the admin will receive this "error" message, cause there was no ID found.
	SetPlayerScore(id, score);  //Sets the targets score.
	format(string, sizeof(string), "Administrator %s has given you some score!", name); //Target receives this message.
	SendClientMessage(id, 0xFF0000AA, string);
	return 1;
}
en mi carpeta scriptfiles/users solo me sale esto en un usuario creado y registrado.

Код:
Password=blablablabla
Level=5   (--es level de admistrador solo eso guarda.
Weather=0
Time=12
ChatChannel=-1
En dni tengo entre otras cosas esto

Код:
IsSpectatingID,
	Level,
	ChatChannel,
	Weather,
	Time,
	Team,
	DLlast,
	FPS,
Код:
// Reset all variables (So that the connected player don't have the same variable values as the player that left with the same playerid)

	Player[playerid][Level] = 0;
	Player[playerid][Weather] = MainWeather;
	Player[playerid][Time] = MainTime;
	Player[playerid][DMReadd] = 0;
	Player[playerid][ChatChannel] = -1;
	Player[playerid][RoundKills] = 0;
	Player[playerid][RoundDeaths] = 0;
mas abajo



Код:
  dini_Set(pProfile(playerid),"Password", HashPass);
		    dini_IntSet(pProfile(playerid),"Level", 0);
		    dini_IntSet(pProfile(playerid),"Weather", MainWeather);
		    dini_IntSet(pProfile(playerid),"Time", MainTime);
		    dini_IntSet(pProfile(playerid),"ChatChannel", -1);

			Player[playerid][Level] = 0;
			Player[playerid][Weather] = MainWeather;
			Player[playerid][Time] = MainTime;
		    Player[playerid][Logged] = true;
		    Player[playerid][ChatChannel] = -1;

			format(HashPass, sizeof(HashPass), "{0099FF}You have been successfully registered. {FFFFFF}Password: %s", inputtext);
			SendClientMessage(playerid, -1, HashPass);
y esto


Код:
if(strcmp(HashPass, CurrentPassword, true) == 0) {
			    Player[playerid][Level] = dini_Int(pProfile(playerid),"Level");
			    Player[playerid][Weather] = dini_Int(pProfile(playerid),"Weather");
		        Player[playerid][Time] = dini_Int(pProfile(playerid),"Time");
		        Player[playerid][ChatChannel] = dini_Int(pProfile(playerid),"ChatChannel");

                if(Player[playerid][ChatChannel] != -1) OnlineInChannel[Player[playerid][ChatChannel]]++;

		        SetPlayerWeather(playerid, Player[playerid][Weather]);
		        SetPlayerTime(playerid, Player[playerid][Time], 0);

		        Player[playerid][Logged] = true;

				format(HashPass, sizeof(HashPass), "{0099FF}You have successfullly logged in. {FFFFFF}Level: %d", Player[playerid][Level]);
		        SendClientMessage(playerid,-1,HashPass);

No se que le falta al dni para que guarde el score kills deaths y dinero.
intento agregando lo que falte copilo no da errores pero no me gaurda nada,asi que borro el pawn y empiezo de nuevo,alguien que sepa gracias.
Reply
#2

Dini? es un poco anticuado cбmbiate a otro Sistema de Guardado..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)