Level and Exp system
#1

Hey i have a problem with a Level and Exp when i type /buylevel it give me level up but when i disconect form de server and i go back on it i don't have the level

Код:
CMD:buylevel(playerid,params[])
{
		new string[30]; 
		if(IsPlayerConnected(playerid) == 1) 
	    {
	        new points[248]; 
            new nxtlevel = Player[playerid][pLevel]+1; 
    		new expamount = nxtlevel*levelexp; 
	        if(Player[playerid][pExp] < expamount) 
	        {
				format(points,sizeof(points)," You need [%d] Exp Points in order to level up, You currently have [%d]",expamount,Player[playerid][pExp]); // Format, This is pretty obvious.
				SendClientMessage(playerid,0xFFFFFFC8,points);
				return 1;
			}
			else
			{
				Player[playerid][pExp] = 0; 
				Player[playerid][pLevel]++; 
				format(string,sizeof(string),"~g~Your now level:[%d]",Player[playerid][pLevel]); 
				GameTextForPlayer(playerid,string,6000,1);
				SavePlayer(playerid);
				return 1;
			}
		}
		return 1;
}
Код:
forward ScoreUpdate();
public ScoreUpdate()
{
	new Score;
	new name[MAX_PLAYER_NAME];
	//new string[256];
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if (IsPlayerConnected(i))
		{
			GetPlayerName(i, name, sizeof(name));
   			Score = Player[i][pLevel];
			SetPlayerScore(i, Score);
			if (Score > ScoreOld)
			{
				ScoreOld = Score;
			}
		}
	}
}
I use MySQL!!!
Reply


Messages In This Thread
Level and Exp system - by AnoTek - 17.08.2015, 16:51
Re: Level and Exp system - by MichaelJones - 17.08.2015, 16:53
Re: Level and Exp system - by AnoTek - 17.08.2015, 16:56
Re : Level and Exp system - by MrAlexisX2 - 17.08.2015, 17:03
Re: Level and Exp system - by AnoTek - 17.08.2015, 17:08
Re: Re : Level and Exp system - by AnoTek - 17.08.2015, 17:12
Re: Level and Exp system - by DanielMc - 17.08.2015, 17:16
Re : Level and Exp system - by MrAlexisX2 - 17.08.2015, 17:16
Re: Level and Exp system - by Tamer - 17.08.2015, 17:17
Re: Re : Level and Exp system - by AnoTek - 17.08.2015, 17:23

Forum Jump:


Users browsing this thread: 1 Guest(s)