SA-MP Forums Archive
Score problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Score problem (/showthread.php?tid=550393)



Score problem - ZaBraNjeNi - 12.12.2014

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.


Re: Score problem - Lordzy - 12.12.2014

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


Re: Score problem - ZaBraNjeNi - 12.12.2014

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



Re: Score problem - Lordzy - 12.12.2014

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



Re: Score problem - ZaBraNjeNi - 12.12.2014

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