09-15-2011, 00:44
(This post was last modified: 09-15-2011, 10:45 by SuperNovaAO.)
Code:
#include common_scripts\utility;
#include maps\mp\_airsupport;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
init()
{
thread onPlayerConnect();
thread onPlayerConnected();
thread createElevator( ( 0, 0, 0 ), ( 0, 90, 0 ) );
}
onPlayerConnect()
{
for(;;)
{
level waittill( "connecting", player );
player thread onPlayerSpawned();
}
}
onPlayerConnected()
{
for(;;)
{
level waittill( "connected", player );
}
}
onPlayerSpawned()
{
for(;;)
{
self waittill( "spawned_player" );
}
}
createElevator( origin, angle )
{
level.isMoving = false;
level.Position = 0;
Center = spawn( "trigger_radius", origin, 0, 25, 50 );
level.Elevator[0] = createBlock( origin, angle );
level.Elevator[1] = createBlock( origin + ( 0, 35, 0 ), angle );
Center thread monitorDistance( origin );
}
createBlock( origin, angle )
{
block = spawn( "script_model", origin );
block setModel( "mp_supplydrop_ally" );
block.angles = angle;
}
monitorDistance( origin )
{
while( 1 )
{
self waittill( "trigger", player );
if( player useButtonPressed() == true )
{
if( level.isMoving == true ) player iPrintlnBold( "Elevator is Already in Use" );
else if( level.isMoving == false ) self thread moveToPosition( origin, player );
}
wait 0.05;
}
}
moveToPosition( origin, player )
{
if( level.Position == 1000 ) level.Position = 0;
else if( level.Position == 0 ) level.Position = 1000;
for( i = 0; i < level.Elevator.size; i++ ) level.Elevator[i] moveTo( origin + ( 0, 0, level.Position ), 5 );
wait 0.01;
player enableinvulnerability();
level.isMoving = true;
wait 4.99;
player disableinvulnerability();
level.isMoving = false;
}
Whats wrong with this?
Everytime I use this, it just says the Elevator is in Use