Score problem
#1

Hi,

When player answers at the question he need to get money and score, I get money but not and score.
What's wrong with this code?

Код:
public OnPlayerText(playerid, text[])
{
        if(strval(text) == answer && endm == 1)
        {
            format(str, sizeof(str), "MATH: %s(%d) won the Math Contest $%d + %i score [ Answer: %d ]", GetName(playerid), playerid, PRIZE, PRIZESCORE, answer);
            SendClientMessageToAll(COLOR_YELLOW, str);
            GivePlayerMoney(playerid, PRIZE);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + PRIZESCORE);
            KillTimer(timermath2);
            endm = 0;
            return 0;
        }
        return 1;
}
Thanks.
Reply
#2

Check if your PRIZESCORE definition isn't 0 or not.
Reply
#3

It's defined.
Код:
#define  PRIZESCORE       1
Reply
#4

Try debugging your codes:
pawn Код:
//After giving cash,
printf("old score : %d", GetPlayerScore(playerid));
//Then set.
printf("new score : %d", GetPlayerScore(playerid));
Reply
#5

Just this show at the server log:
Код:
[18:08:01] old score : 101
[18:08:01] new score : 101
Problem is still.
Reply


Forum Jump:


Users browsing this thread: