"Score" help
#5

Quote:
Originally Posted by Vexus
Посмотреть сообщение
Yeah, that's why I am confused.
Код:
public DollahScoreUpdate()
{
	new LevScore;
	for(new i=0; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
   			LevScore = PlayerInfo[i][pLevel];
			SetPlayerScore(i, LevScore);
		}
	}
	return 1;
}
Does this seem right? It seems right to me...
Well I have this in my /buylevel
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);

So what that is doing is setting their score based on their level when they /buy level.

For you I will put my /buylevel command here
pawn Код:
CMD:buylevel(playerid, params[])
{
    if (gPlayerLogged{playerid} != 0)
    {
        if(PlayerInfo[playerid][pLevel] >= 0)
        {
            new nxtlevel = PlayerInfo[playerid][pLevel]+1;
            new costlevel = nxtlevel*25000;
            new expamount = nxtlevel*4;

            if(GetPlayerCash(playerid) < costlevel)
            {
                new string[128];
                format(string, sizeof(string), "You don't have enough cash ($%d).",costlevel);
                SendClientMessageEx(playerid, COLOR_GRAD1, string);
                return 1;
            }
            else if (PlayerInfo[playerid][pExp] < expamount)
            {
                new string[58];
                format(string, sizeof(string), "You need %d more respect points to buy your next level.", expamount - PlayerInfo[playerid][pExp]);
                SendClientMessageEx(playerid, COLOR_GRAD1, string);
                return 1;
            }
            else
            {
                new string[92];
                format(string, sizeof(string), "~g~LEVEL UP~n~~w~You Are Now Level %d", nxtlevel);
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                GivePlayerCash(playerid, (-costlevel));
                PlayerInfo[playerid][pLevel]++;
                PlayerInfo[playerid][pExp] = PlayerInfo[playerid][pExp]-expamount;
                PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
                GameTextForPlayer(playerid, string, 5000, 1);
                format(string, sizeof(string), "You have bought level %d for $%d, and gained %i upgrade points! /upgrade to use them.", nxtlevel, costlevel, PlayerInfo[playerid][gPupgrade]);
                SendClientMessageEx(playerid, COLOR_GRAD1, string);
                SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
                if(PlayerInfo[playerid][pLevel] == 6)
                {
                    SendClientMessageEx(playerid, COLOR_WHITE, "Newbie chat will now be automatically togged off on login.");
                }
            }
        }
        return 1;
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You're not logged in.");
    }
    return 1;
}
Reply


Messages In This Thread
[SOLVED] - by Vexus - 26.10.2012, 05:56
Re: "Score" help - by [TC]XxJuggaloxX - 26.10.2012, 06:00
Re: "Score" help - by Vexus - 27.10.2012, 06:11
Re: "Score" help - by xplor09edy - 27.10.2012, 06:18
Re: "Score" help - by [TC]XxJuggaloxX - 27.10.2012, 06:43

Forum Jump:


Users browsing this thread: 3 Guest(s)