Added small_scripts

This commit is contained in:
Resxt 2022-03-09 23:26:11 +01:00
parent 899431bed2
commit d9cc0ae2ce
2 changed files with 53 additions and 0 deletions

7
small_scripts/README.md Normal file
View File

@ -0,0 +1,7 @@
# Small scripts
Simple drag and drop scripts
## display_player_stats.gsc
Display the player's killstreak, total kills and deaths on top of the screen

View File

@ -0,0 +1,46 @@
#include maps\mp\gametypes\_hud_util;
init()
{
level thread OnPlayerConnected();
}
OnPlayerConnected()
{
for(;;)
{
level waittill("connected", player);
if (isDefined(self.pers["isBot"]))
{
if (self.pers["isBot"])
{
return;
}
}
player thread DisplayPlayerKillstreak();
}
}
DisplayPlayerKillstreak()
{
self endon ("disconnect");
level endon("game_ended");
self.hudkillstreak = createFontString( "Objective", 0.65 );
self.hudkillstreak setPoint( "CENTER", "TOP", "CENTER", 10 );
while(true)
{
if(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"]);
}
wait 0.01;
}
}