mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-19 20:52:54 +00:00
display_player_stats 1.1
Fix threading on bots Fix stats only changing when player did a kill Refactor Add image
This commit is contained in:
parent
bd4bdc06f4
commit
7a9b271e1f
@ -5,6 +5,11 @@ Simple drag and drop scripts
|
|||||||
## display_player_stats.gsc
|
## display_player_stats.gsc
|
||||||
|
|
||||||
Display the player's killstreak, total kills and deaths on top of the screen
|
Display the player's killstreak, total kills and deaths on top of the screen
|
||||||
|
<details>
|
||||||
|
<summary>Image</summary>
|
||||||
|
|
||||||
|

|
||||||
|
</details>
|
||||||
|
|
||||||
## change_team_names.gsc
|
## change_team_names.gsc
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include maps\mp\gametypes\_hud_util;
|
#include maps\mp\gametypes\_hud_util;
|
||||||
|
|
||||||
|
Init()
|
||||||
init()
|
|
||||||
{
|
{
|
||||||
level thread OnPlayerConnected();
|
level thread OnPlayerConnected();
|
||||||
}
|
}
|
||||||
@ -12,9 +11,10 @@ OnPlayerConnected()
|
|||||||
{
|
{
|
||||||
level waittill("connected", player);
|
level waittill("connected", player);
|
||||||
|
|
||||||
if (isDefined(self.pers["isBot"]))
|
// Don't thread DisplayPlayerKillstreak() on bots
|
||||||
|
if (isDefined(player.pers["isBot"]))
|
||||||
{
|
{
|
||||||
if (self.pers["isBot"])
|
if (player.pers["isBot"])
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -30,16 +30,13 @@ DisplayPlayerKillstreak()
|
|||||||
self endon ("disconnect");
|
self endon ("disconnect");
|
||||||
level endon("game_ended");
|
level endon("game_ended");
|
||||||
|
|
||||||
self.hudkillstreak = createFontString( "Objective", 0.65 );
|
self.stats_text = createFontString( "Objective", 0.65 );
|
||||||
self.hudkillstreak setPoint( "CENTER", "TOP", "CENTER", 10 );
|
self.stats_text setPoint( "CENTER", "TOP", "CENTER", 7.5 );
|
||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
|
||||||
if(self.playerstreak != self.pers["cur_kill_streak"])
|
|
||||||
{
|
{
|
||||||
self.playerstreak = self.pers["cur_kill_streak"];
|
self.playerstreak = self.pers["cur_kill_streak"];
|
||||||
self.hudkillstreak setText("^1KILLSTREAK: " + self.pers["cur_kill_streak"] + " | KILLS: " + self.pers["kills"] + " | DEATHS: " + self.pers["deaths"]);
|
self.stats_text setText("^1KILLSTREAK: " + self.pers["cur_kill_streak"] + " | KILLS: " + self.pers["kills"] + " | DEATHS: " + self.pers["deaths"]);
|
||||||
}
|
|
||||||
|
|
||||||
wait 0.01;
|
wait 0.01;
|
||||||
}
|
}
|
||||||
|
BIN
small_scripts/images/display_player_stats.png
Normal file
BIN
small_scripts/images/display_player_stats.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 MiB |
Loading…
x
Reference in New Issue
Block a user