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