mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 22:05:44 +00:00
test
This commit is contained in:
parent
91a7d462e1
commit
b76ed0995b
71
userraw/scripts/spawnTest.gsc
Normal file
71
userraw/scripts/spawnTest.gsc
Normal file
@ -0,0 +1,71 @@
|
||||
init()
|
||||
{
|
||||
if ( getDvarInt( "spawnpoints_test" ) )
|
||||
level thread doSpawnPointTest();
|
||||
}
|
||||
|
||||
drawNoSight(sp)
|
||||
{
|
||||
newdeathicon = newHudElem();
|
||||
newdeathicon.x = sp.origin[0];
|
||||
newdeathicon.y = sp.origin[1];
|
||||
newdeathicon.z = sp.origin[2] + 32;
|
||||
newdeathicon.alpha = .61;
|
||||
newdeathicon.archived = true;
|
||||
newdeathicon setShader( "headicon_dead", 5, 5 );
|
||||
newdeathicon setwaypoint( true, false );
|
||||
|
||||
if (isDefined(sp.wp))
|
||||
sp.wp destroy();
|
||||
|
||||
sp.wp = newdeathicon;
|
||||
}
|
||||
|
||||
drawSight(sp)
|
||||
{
|
||||
newdeathicon = newHudElem();
|
||||
newdeathicon.x = sp.origin[0];
|
||||
newdeathicon.y = sp.origin[1];
|
||||
newdeathicon.z = sp.origin[2] + 32;
|
||||
newdeathicon.alpha = .61;
|
||||
newdeathicon.archived = true;
|
||||
newdeathicon setShader( "rank_prestige1", 5, 5 );
|
||||
newdeathicon setwaypoint( true, false );
|
||||
|
||||
if (isDefined(sp.wp))
|
||||
sp.wp destroy();
|
||||
|
||||
sp.wp = newdeathicon;
|
||||
}
|
||||
|
||||
doSpawnPointTest()
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
wait 0.05;
|
||||
|
||||
if ( !isdefined( level.spawnpoints ) )
|
||||
return;
|
||||
|
||||
for (i = 0; i < level.spawnpoints.size; i++)
|
||||
{
|
||||
spawnpoint = level.spawnpoints[i];
|
||||
|
||||
sight = false;
|
||||
|
||||
if (level.teamBased)
|
||||
{
|
||||
sight = (spawnpoint.sights["axis"] > 0);
|
||||
if (!sight)
|
||||
sight = (spawnpoint.sights["allies"] > 0);
|
||||
}
|
||||
else
|
||||
sight = (spawnpoint.sights > 0);
|
||||
|
||||
if (!sight)
|
||||
drawNoSight(spawnpoint);
|
||||
else
|
||||
drawSight(spawnpoint);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user