61 lines
8.9 KiB
Plaintext
61 lines
8.9 KiB
Plaintext
#using scripts\codescripts\struct;
|
|
|
|
#using scripts\shared\callbacks_shared;
|
|
#using scripts\shared\clientfield_shared;
|
|
#using scripts\shared\filter_shared;
|
|
#using scripts\shared\system_shared;
|
|
#using scripts\shared\util_shared;
|
|
#using scripts\shared\vehicle_shared;
|
|
|
|
|
|
|
|
|
|
#namespace mechtank;
|
|
|
|
function autoexec __init__sytem__() { system::register("mechtank",&__init__,undefined,undefined); }
|
|
|
|
function __init__()
|
|
{
|
|
vehicle::add_vehicletype_callback( "mechtank", &_setup_ );
|
|
}
|
|
|
|
function _setup_( localClientNum )
|
|
{
|
|
self thread player_enter( localClientNum );
|
|
self thread player_exit( localClientNum );
|
|
}
|
|
|
|
function player_enter( localClientNum )
|
|
{
|
|
self endon( "death" );
|
|
self endon( "entityshutdown" );
|
|
|
|
while( 1 )
|
|
{
|
|
self waittill( "enter_vehicle", player );
|
|
|
|
if( self IsLocalClientDriver( localClientNum ) )
|
|
{
|
|
self SetHighDetail( true );
|
|
}
|
|
|
|
wait .016;
|
|
}
|
|
}
|
|
|
|
function player_exit( localClientNum )
|
|
{
|
|
self endon( "death" );
|
|
self endon( "entityshutdown" );
|
|
|
|
while( 1 )
|
|
{
|
|
self waittill( "exit_vehicle", player );
|
|
if( isdefined( player ) && player islocalplayer() )
|
|
{
|
|
self SetHighDetail( false );
|
|
}
|
|
wait .016;
|
|
}
|
|
}
|