Quote:
Originally Posted by Nero_3D
Put it in OnPlayerDeath ...
pawn Код:
// if(killerid != INVALID_PLAYER_ID || killerid != playerid) { new rand = random(sizeof(SoundOnDeath)), Float:Xk, Float:Yk, Float:Zk; GetPlayerPos(killerid, Xk, Yk, Zk); PlayerPlaySound(killerid, SoundOnDeath[rand][0],Xk,Yk,Zk); SendDeathMessage(killerid, playerid, reason); SetPVarInt(killerid, "PKills", PlayerInfo[killerid][pKills]++); SetPVarInt(playerid, "PDeaths", PlayerInfo[playerid][pDeaths]++); roundstats[playerid][rKills]++; roundstats[playerid][rDeaths]++; SetPlayerHealth(killerid, 100); SetPlayerArmour(killerid, 100);
new topkillermessage[128]; new highestkillerid = GetHighestKiller(); GetPlayerName(highestkillerid, topkillermessage, MAX_PLAYER_NAME); strcat(topkillermessage, " has the most amount of kills."); TextDrawSetString(YOUR_TEXTDRAW, topkillermessage); }
At YOUR_TEXTDRAW you need to use the textdraw you created in OnGameModeInit, also the OLD textdraw which you store in a variable
|
shouldn't I use ?
Код:
new LASTMESSAGE[100];
strcat(LASTMESSAGE,topkillermessage, " has the most amount of kills.");
TextDrawSetString(LASTMESSAGE, topkillermessage);
because there isn't any new textdraw that I created in OnGameModeInit callback and it would be out of bounds since it's in another callback (OnGameModeInit and OnPlayerDeath).
What do you think?
EDIT: I'm going to use Timers and public functions, see where that leads me. I will update you =)