"Score" help
#1

[SOLVED]
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerScore
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);

Just make that for every time they level up and it will update their score in tab
Reply
#3

Quote:
Originally Posted by [TC]XxJuggaloxX
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/SetPlayerScore
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);

Just make that for every time they level up and it will update their score in tab
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...
Reply
#4

You can use something like this:
Код:
OnPlayerConnect(playerid) {
SetPlayerScore(playerid, GetPlayerInfo[Level]);
return 1; }
Something like this, i don't remember what info have ravens
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)