« [Custom Object] Train(Tracks Included)!!
[Custom Object] Bank Gate With Time
[Custom Object] Wrestling Ring »

MacTavish

  • Hero Member
  • Nicks( Kusanagi, Beztone, RATHORE )
  • Posts: 809
[Custom Object] Bank Gate With Time
« on July 8th, 2015, 07:11 AM »Last edited on May 27th, 2016, 07:18 AM
I know it is not hard to implement but its just a promo of my new server Extreme City - Real Life Roleplay

By default the gate will auto close at night 22:01 and auto open at 06:01

Have fun with this ;)

ScreenShots:
http://i61.tinypic.com/fu3r6x.png
http://i62.tinypic.com/29vzbea.png


Code: [Select]
onScriptLoad()
{
bd1 <- CreateObject(6000, 0, Vector(-897.365, -342.66, 9.6187),255);
bd1.RotateToEuler(Vector(3.13319, 0, -0),0);
bd2 <- CreateObject(6001, 0, Vector(-897.355, -339.4, 9.6187),255);
bd2.RotateToEuler(Vector(3.13318, -3.79681e-010, -6.16084e-010),0);
}

function onTimeChange(oldHour, oldMin, newHour, newMin)
{
if ( oldHour == 06 && oldMin == 00 )
{
Message("Bank Opened");
bd1.MoveTo(Vector(-897.365, -342.66, 9.6187),2000);
bd2.MoveTo(Vector(-897.355, -339.4, 9.6187),2000);
}
else if( oldHour == 22 && oldMin == 00 )
{
Message("Bank Closed");
bd1.MoveTo(Vector(-897.365, -342.66, 13.6187),2000);
bd2.MoveTo(Vector(-897.355, -339.4, 13.6187),2000);
}
}



Note: you can create an pickup/sphere inside the bank to threw player outside if the stuck in bank when gate is closed :)

Edited: The Object.xml and onScriptLoad Updated
Edited 2: timer remove and added onTimeChange ( Thanks @Thijn)

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

[VSS]Shawn

  • Full Member
  • Posts: 210
[Custom Object] Re: Bank Gate With Time
« Reply #1, on July 8th, 2015, 09:34 AM »
What Fun you need to post screen shot

MacTavish

  • Hero Member
  • Nicks( Kusanagi, Beztone, RATHORE )
  • Posts: 809
[Custom Object] Re: Bank Gate With Time
« Reply #2, on July 8th, 2015, 09:52 AM »
Quote from [VSS]Shawn on July 8th, 2015, 09:34 AM
What Fun you need to post screen shot
sorry i can't upload pics cause lack of internet, you can try it and post pics here

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

[VSS]Shawn

  • Full Member
  • Posts: 210
[Custom Object] Re: Bank Gate With Time
« Reply #3, on July 8th, 2015, 11:39 AM »
Bro i visit whole bank there is no gate i set timerate 1 and check 21:00 no gate
i add objects at main.nut function in functions and in stores unp files and in objects.xml

MacTavish

  • Hero Member
  • Nicks( Kusanagi, Beztone, RATHORE )
  • Posts: 809
[Custom Object] Re: Bank Gate With Time
« Reply #4, on July 8th, 2015, 12:50 PM »
Quote from [VSS]Shawn on July 8th, 2015, 11:39 AM
Bro i visit whole bank there is no gate i set timerate 1 and check 21:00 no gate
i add objects at main.nut function in functions and in stores unp files and in objects.xml
I Updated The First Post Please See And ScreenShots Added

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

Thijn

  • VC:MP Beta Tester
  • Posts: 1,689
[Custom Object] Re: Bank Gate With Time
« Reply #5, on July 8th, 2015, 05:55 PM »
Why use a 1 second infinite timer, when there's onTimeChange(oldHour, oldMin, newHour, newMin)

MacTavish

  • Hero Member
  • Nicks( Kusanagi, Beztone, RATHORE )
  • Posts: 809
[Custom Object] Re: Bank Gate With Time
« Reply #6, on July 8th, 2015, 07:11 PM »
Quote from Thijn on July 8th, 2015, 05:55 PM
Why use a 1 second infinite timer, when there's onTimeChange(oldHour, oldMin, newHour, newMin)
Thanks, i didnt knew about that

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

[VSS]Shawn

  • Full Member
  • Posts: 210
[Custom Object] Re: Bank Gate With Time
« Reply #7, on July 8th, 2015, 07:41 PM »
Seems Good Thanks Works

OFF:Thanks Lasapapu

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 946
[Custom Object] Re: Bank Gate With Time
« Reply #8, on July 8th, 2015, 08:57 PM »
By the way, these doors are no custom objects. ;)

[VSS]Shawn

  • Full Member
  • Posts: 210

Finch Real

  • Sr. Member
  • Posts: 282
[Custom Object] Re: Bank Gate With Time
« Reply #10, on May 26th, 2016, 05:05 PM »
Sorry for Bump

Can you post somewhere else?
My Snipet Showroom

http://pastebin.com/5KKuU5cg

KAKAN

  • Wiki Contributor
  • Posts: 3,346
[Custom Object] Re: Bank Gate With Time
« Reply #11, on May 26th, 2016, 05:51 PM »
Don't use this. There is a system-default object for that door :)
Though, Thijn might host a mirror
You can contact me using Discord, at Developers.CPP( check off-board to find the invite link )
Github: https://github.com/theKAKAN

MacTavish

  • Hero Member
  • Nicks( Kusanagi, Beztone, RATHORE )
  • Posts: 809

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

« [Custom Object] Train(Tracks Included)!!
[Custom Object] Wrestling Ring »