#1

Help please.
I have a problem. I installed textdraw (found somewhere on the forum) which shows your Level and Respect. It shows level and respects properly, but number of Respects needed for new level is always shown as 4. The problem in levelexp, am I right? It's set to 'new levelexp = 4' by default
This Code:
Код:
if(gPlayerLogged[i] == 1)
{
TextDrawHideForPlayer(i, InfoTextDraw);
format(string,sizeof(string),"LVL: %d~n~Respect: %d/%d",PlayerInfo[i][pLevel],PlayerInfo[i][pExp],levelexp);
InfoTextDraw = TextDrawCreate(547.000000,40.000000,string);
TextDrawAlignment(InfoTextDraw,0);
TextDrawBackgroundColor(InfoTextDraw,0x000000ff);
TextDrawFont(InfoTextDraw,1);
TextDrawLetterSize(InfoTextDraw,0.299999,1.100000);
TextDrawColor(InfoTextDraw,0xffffffff);
TextDrawSetOutline(InfoTextDraw,1);
TextDrawSetProportional(InfoTextDraw,1);
TextDrawSetShadow(InfoTextDraw,1);
TextDrawShowForPlayer(i, InfoTextDraw);
}
Reply
#2

Well, if you've set 'levelexp' to 4, it'll output 4. If it's like: Level 1: 4 xp - Level 2: 8xp - Level 3: 12xp

Then try this:

pawn Код:
format(string,sizeof(string),"LVL: %d~n~Respect: %d/%d",PlayerInfo[i][pLevel],PlayerInfo[i][pExp],levelexp*(PlayerInfo[i][pLevel]+1)); // Gets the player's level, counts +1 (Next level) and multiplies it by 4 (XP required for one next level)
Reply
#3

Quote:
Originally Posted by Hiddos
Well, if you've set 'levelexp' to 4, it'll output 4. If it's like: Level 1: 4 xp - Level 2: 8xp - Level 3: 12xp

Then try this:

pawn Код:
format(string,sizeof(string),"LVL: %d~n~Respect: %d/%d",PlayerInfo[i][pLevel],PlayerInfo[i][pExp],levelexp*(PlayerInfo[i][pLevel]+1)); // Gets the player's level, counts +1 (Next level) and multiplies it by 4 (XP required for one next level)
Wouldn't that output level 1: 5xp 2: 10 xp and so on, as if levelexp is 4 and you times it with the level +1 you wont get 4,8,12 and so on.
Reply
#4

Quote:
Originally Posted by Naxix
Quote:
Originally Posted by Hiddos
Well, if you've set 'levelexp' to 4, it'll output 4. If it's like: Level 1: 4 xp - Level 2: 8xp - Level 3: 12xp

Then try this:

pawn Код:
format(string,sizeof(string),"LVL: %d~n~Respect: %d/%d",PlayerInfo[i][pLevel],PlayerInfo[i][pExp],levelexp*(PlayerInfo[i][pLevel]+1)); // Gets the player's level, counts +1 (Next level) and multiplies it by 4 (XP required for one next level)
Wouldn't that output level 1: 5xp 2: 10 xp and so on, as if levelexp is 4 and you times it with the level +1 you wont get 4,8,12 and so on.
levelexp*(PlayerInfo[i][pLevel]+1)

Code between () will be calculated before it calculates with something else.
Wrong would be:

levelexp*(PlayerInfo[i][pLevel])+1
Reply
#5

Oh, sorry didn't see the "+1" was inside the ( ). My mistake.
Reply
#6

Thx to all, it's working
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)