fix error

This commit is contained in:
ineedbots 2021-09-14 15:46:34 -06:00
parent e0ad486ee0
commit ca2f3c8f7c

View File

@ -5,47 +5,49 @@
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)
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 thread destoryHPdraw();
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();
}
@ -54,13 +56,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;
}
}