TextDrawSetString
#1

Ok so I am trying to set a string to a textdraw however it doesn't work here is the code I have can someone point out what the issue is and why the textdraw stays the same after a player dies or gets murdered by another player

under ongamemodeinit
pawn Код:
RoundTxtDrw = TextDrawCreate( 0, 435, "  Allies: 0/0                                                        Axis 0/0");
    TextDrawFont(RoundTxtDrw , 1);
    TextDrawLetterSize(RoundTxtDrw, 0.5, 1.5);
    TextDrawColor(RoundTxtDrw, COLOR_WHITE);
    TextDrawSetOutline(RoundTxtDrw , false);
    TextDrawSetProportional(RoundTxtDrw , true);
    TextDrawSetShadow(RoundTxtDrw , 1);
    TextDrawUseBox(RoundTxtDrw, 1);
    TextDrawBoxColor(RoundTxtDrw, 0x000000FF);
I show the player the textdraw under onplayerspawn



and here is where I set the string of the textdraw
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    pKills[killerid] ++;
    pDeaths[playerid] ++;
    if(roundinprogress == true)
    {
        new string[128];
        SpawnInRound(playerid);
        if(gTeam[playerid] == 0)
        {
            if(killerid == INVALID_PLAYER_ID)
            {
                AXISDEATHS ++;
            }
            if(killerid != INVALID_PLAYER_ID)
            {
                ALLIESKILLS ++;
            }
        }
        if(gTeam[playerid] == 1)
        {
            if(killerid == INVALID_PLAYER_ID)
            {
                ALLIESDEATHS ++;
            }
            if(killerid != INVALID_PLAYER_ID)
            {
                AXISKILLS ++;
            }
        }
        format(string, sizeof(string),        "  Allies: %i/%i                                                      Axis: %i/%i", ALLIESKILLS, ALLIESDEATHS, AXISKILLS, AXISDEATHS);
        TextDrawSetString(RoundTxtDrw, string);
        for(new t; t<MAX_PLAYERS; t++)
        {
            TextDrawShowForPlayer(t, RoundTxtDrw);
        }

    }
    return 1;
}
Reply


Messages In This Thread
TextDrawSetString - by new121 - 19.03.2012, 02:26
Re: TextDrawSetString - by DarkScripter - 19.03.2012, 03:01
Re: TextDrawSetString - by -Rebel Son- - 19.03.2012, 03:23
Re: TextDrawSetString - by new121 - 19.03.2012, 03:23

Forum Jump:


Users browsing this thread: 3 Guest(s)