Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///VCMP 0.4 Automatic gate system by SouLy^///
- Thanks to Gudio for helping me with onPlayerPart function :D
- This function adds a automatic gate at mansion. Enjoy
- function onScriptLoad()
- {
- gate <- CreateObject( 310, 1, -276.618, -495.992, 10.2778, 255 );
- gate_timer <- NewTimer("gatesystem", 500, 0 );
- gate_timer.Paused = true;
- timer_status <- false;
- }
- function onPlayerJoin( player )
- {
- if(timer_status == false)
- {
- gate_timer.Paused = false;
- timer_status = true;
- print("Timer Resumed");
- }
- }
- function onPlayerPart( player, reason )
- {
- if ( GetPlayers()-1 == 0 )
- {
- gate_timer.Paused = true;
- timer_status = false;
- print( "Timer Paused" );
- }
- }
- function gatesystem()
- {
- local gatestatus = 0;
- for ( local i = 0; i < GetMaxPlayers(); i++ )
- {
- local player = FindPlayer( i );
- if ( player )
- {
- if ( player.IsSpawned )
- {
- if ( InPoly( player.Pos.x, player.Pos.y, -276.2,-503.462,-268.675,-502.296,-268.887,-488.42,-276.471,-487.991 ) ) gatestatus = 1;
- }
- }
- }
- if ( gatestatus == 1 ) gate.MoveTo( Vector( -268.576, -495.99, 10.2778 ), 2800 );
- else gate.MoveTo( Vector( -276.618, -495.992, 10.2778 ), 2800 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement