[Problem] Textdraw
#1

Solved.
Reply
#2

Show your onplayerdeath, be sure you add ++ to Information[playerid][pKills] or Information[playerid][pDeaths].
Also you should put this onplayerupdate code inside your onplayerdeath, because it's not needed to update this in about each 500 ms...
Reply
#3

Yes, i have this code in OnPlayerDeath:

Код:
if(killerid == INVALID_PLAYER_ID)
    {
    Information[playerid][pDeaths]++;
    SetPlayerScore(killerid, GetPlayerScore(killerid)-1);
    }
    else
    {
    Information[killerid][pKills]++;
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    }
Reply
#4

Try hiding then re-showing it. Some textdraws bug like this and won't update unless they're hidden and re-shown.

pawn Код:
TextDrawHideForPlayer( playerid, textdrawID );
TextDrawShowForPlayer( playerid, textdrawID );
Obviously replace textdrawID with the actual IDs, and be sure to do this for every textdraw that doesn't work after setting its string.
Reply
#5

LarzI, i do this and textdraws don't updated..
Reply
#6

Quote:
Originally Posted by Loox
Посмотреть сообщение
LarzI, i do this and textdraws don't updated..
Then I'm not really sure why it doesn't work, although I don't think it's too smart to put this in OnPlayerUpdate. Why don't you just change it when it actually happens - OnPlayerDeath - instead of updating it all the time?
Reply
#7

do you have me any example to do the code with this form?
Reply
#8

Well
pawn Код:
Information[playerid][pDeaths]++;
if(killerid == INVALID_PLAYER_ID)
{
    SetPlayerScore(killerid, GetPlayerScore(killerid)-1);
}
else
{
    Information[killerid][pKills]++;
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
}
format(String, sizeof(String), "KILLS: ~y~%d", Information[killerid][pKills]);
TextDrawSetString(Killer[killerid], String);

format(String, sizeof(String), "DEATHS: ~y~%d", Information[playerid][pDeaths]);
TextDrawSetString(Dead[playerid], String);

/* format(String, sizeof(String), "~y~%s", NombreJugador(playerid));
TextDrawSetString(Nombre[playerid], String); */
// I'm unsure what this is, that's why I just commented it

/* format(String, sizeof(String), "RANK: ~y~%s", rango);
TextDrawSetString(Ranking[playerid], String); */
//show us rango before you uncomment this please

format(String, sizeof(String), "KILL RATIO: ~y~%0.2f", Float:Information[playerid][pKills]/Float:Information[playerid][pDeaths]);
TextDrawSetString(Ratio[playerid], String);

format(String, sizeof(String), "KILL RATIO: ~y~%0.2f", Float:Information[killerid][pKills]/Float:Information[killerid][pDeaths]);
TextDrawSetString(Ratio[killerid], String);
Reply
#9

I do with the form you give me, and textdraws not updated xd.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)