What's wrong
#6

You're defining TDS, which is a string.
Then you're saying Textdraw1[playerid] = TextdrawCreate(...).
And then you want to modify the TDS string.
So, this is the correct code:
pawn Код:
//Make sure Textdraw1 is defined as: new Text:Textdraw1[MAX_PLAYERS];
new tds[128];
    format(tds, sizeof(tds), "Score: %d",GetPlayerScore(playerid));
    Textdraw1[playerid] = TextDrawCreate(276.000000, 391.000000, tds);
    TextDrawBackgroundColor(Textdraw1[playerid], 255);
    TextDrawFont(Textdraw1[playerid], 1);
    TextDrawLetterSize(Textdraw1[playerid], 0.500000, 1.799999);
    TextDrawColor(Textdraw1[playerid], -1);
    TextDrawSetOutline(Textdraw1[playerid], 0);
    TextDrawSetProportional(Textdraw1[playerid], 0);
    TextDrawSetShadow(Textdraw1[playerid], 1);
But there's still a problem, you will have to create the textdraw at "OnGameModeInit".
pawn Код:
public OnGameModeInit()
{
//blablabla
    foreach(Player, playerid)
    {
        Textdraw1[playerid] = TextDrawCreate(276.000000, 391.000000, "_");
        TextDrawBackgroundColor(Textdraw1[playerid], 255);
        TextDrawFont(Textdraw1[playerid], 1);
        TextDrawLetterSize(Textdraw1[playerid], 0.500000, 1.799999);
        TextDrawColor(Textdraw1[playerid], -1);
        TextDrawSetOutline(Textdraw1[playerid], 0);
        TextDrawSetProportional(Textdraw1[playerid], 0);
        TextDrawSetShadow(Textdraw1[playerid], 1);
    }
    return 1;
}
//I hope you have a login system which will give them their score.
//If you want to update your textdraw frequently, set a timer.
public OnPlayerSpawn(playerid)
{
    new tds[128];
    format(tds, sizeof(tds), "Score: %d",GetPlayerScore(playerid));
    TextDrawSetString(Textdraw1[playerid], tds);
    TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
     return 1;
}
Edit: lol, Calgon was too fast.
Reply


Messages In This Thread
What's wrong - by Face9000 - 01.06.2011, 08:47
Re: What's wrong - by Hobod - 01.06.2011, 08:52
Re: What's wrong - by Face9000 - 01.06.2011, 08:59
Re: What's wrong - by Hobod - 01.06.2011, 09:02
Re: What's wrong - by Calgon - 01.06.2011, 09:07
Re: What's wrong - by Biesmen - 01.06.2011, 09:09
Re: What's wrong - by Unknown_Killer - 01.06.2011, 09:09
Re: What's wrong - by Calgon - 01.06.2011, 09:11
Re: What's wrong - by Biesmen - 01.06.2011, 09:13
Re: What's wrong - by Calgon - 01.06.2011, 09:13

Forum Jump:


Users browsing this thread: 1 Guest(s)