Round stats text getting over-layed.
#7

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Normally you do it like that, you use a global variable, create the textdraw somewhere at the beginning (= OnGameModeInit), show it to everyone if they connect and update it where you want it (we want it to be if the kill variable change = OnPlayerDeath)
pawn Код:
// globally
new Text: gKillText;
// OnGameModeInit
gKillText = TextDrawCreate(320.0, 240.0, "~r~Highest Kills~n~~w~Noone");
// OnPlayerConnect
TextDrawShowForPlayer(playerid, gKillText);
// OnPlayerDeath
    if(killerid != INVALID_PLAYER_ID || killerid != playerid)
    {
        // CODE

        new string[128];
        GetPlayerName(GetHighestKiller(), string, MAX_PLAYER_NAME);
        format(string, sizeof string, "~r~Highest Kills~n~~w~%s", string);
        TextDrawSetString(gKillText, string);
    }
You don't need timers, just use OnPlayerDeath ... because it is the only place where you increase rKills, isn't it?
If you update it anywhere else (for example if a new round starts) just update the textdraw there likewise

Also there is something wrong with your code "roundstats[playerid][rKills]++;", additionally there is no need to pVars at all
it's late now i'm going to sleep then work on this tomorrow, what's wrong with roundstats[playerid][rKills]++; ?

btw thanks for the help bro
Reply


Messages In This Thread
Round stats text getting over-layed. - by Lofti - 23.07.2015, 21:32
AW: Round stats text getting over-layed. - by Nero_3D - 23.07.2015, 22:56
Re: AW: Round stats text getting over-layed. - by Lofti - 24.07.2015, 02:14
AW: Round stats text getting over-layed. - by Nero_3D - 24.07.2015, 11:24
Re: AW: Round stats text getting over-layed. - by Lofti - 24.07.2015, 23:37
AW: Round stats text getting over-layed. - by Nero_3D - 25.07.2015, 00:53
Re: AW: Round stats text getting over-layed. - by Lofti - 25.07.2015, 01:26
AW: Re: AW: Round stats text getting over-layed. - by Nero_3D - 25.07.2015, 10:13
Re: AW: Re: AW: Round stats text getting over-layed. - by Lofti - 26.07.2015, 23:24

Forum Jump:


Users browsing this thread: 3 Guest(s)