mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 05:55:42 +00:00
fix error
This commit is contained in:
parent
e0ad486ee0
commit
ca2f3c8f7c
@ -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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user