diff --git a/raw/scripts/showHP.gsc b/raw/scripts/showHP.gsc index e16089e..40283c5 100644 --- a/raw/scripts/showHP.gsc +++ b/raw/scripts/showHP.gsc @@ -5,46 +5,48 @@ init() { setDvarIfUninitialized( "scr_showHP", false ); - level.showHP = getDvarInt("scr_showHP"); + level.showHP = getDvarInt( "scr_showHP" ); level thread onPlayerConnect(); } onPlayerConnect() { - for(;;) + for ( ;; ) { - level waittill( "connected", player); + level waittill( "connected", player ); player thread onPlayerSpawned(); } } onPlayerSpawned() { - self endon("disconnect"); - for(;;) - { - self waittill("spawned_player"); + self endon( "disconnect" ); - if(level.showHP) - self thread drawHP(); - } + for ( ;; ) + { + self waittill( "spawned_player" ); + + if ( level.showHP ) + self thread drawHP(); + } } destoryHPdraw() { - self waittill_either("disconnect", "death"); + self endon( "disconnect" ); + self waittill( "death" ); self.drawHP destroy(); self.drawSpeed destroy(); } initHPdraw() { - self.drawHP = self createFontString("default", 1.2); - self.drawHP setPoint("BOTTOMRIGHT", "BOTTOMRIGHT", -150, -20); + self.drawHP = self createFontString( "default", 1.2 ); + self.drawHP setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -150, -20 ); - self.drawSpeed = self createFontString("default", 1.2); - self.drawSpeed setPoint("BOTTOMRIGHT", "BOTTOMRIGHT", -150, -10); + self.drawSpeed = self createFontString( "default", 1.2 ); + self.drawSpeed setPoint( "BOTTOMRIGHT", "BOTTOMRIGHT", -150, -10 ); self thread destoryHPdraw(); } @@ -53,13 +55,14 @@ drawHP() self endon( "disconnect" ); self endon( "death" ); self initHPdraw(); - for(;;) + + for ( ;; ) { //self.drawHP setText("HP: "+self.health+" KS: "+self.pers["cur_kill_streak"]); - self.drawHP setValue(self.health); + self.drawHP setValue( self.health ); vel = self getVelocity(); - self.drawSpeed setValue(int(length((vel[0], vel[1], 0)))); + self.drawSpeed setValue( int( length( ( vel[0], vel[1], 0 ) ) ) ); wait 0.05; } -} \ No newline at end of file +}