score string.
#2

pawn Код:
if(strcmp(cmdtext, "/score", true) == 0)
{
    new string[50];
    new pscore = GetPlayerScore(playerid);
    format(string, sizeof(string), "You're current score is: %d", pscore);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
}
That should work.

GetPlayerScore returns an integer, and you need to save it, hence "pscore = GetPlayerScore(playerid);" (although as JaToch showed you don't HAVE to save it)

As pscore is an integer, you use either %d or %i to represent it in the format().

I also shortened your string as the players score + the text you have will never be longer than 50 characters. However, if you make the string longer you might have to increase the size.
Reply


Messages In This Thread
score string. - by [mad]MLK - 18.08.2009, 13:49
Re: score string. - by Weirdosport - 18.08.2009, 13:51
Re: score string. - by JaTochNietDan - 18.08.2009, 13:51

Forum Jump:


Users browsing this thread: 1 Guest(s)