[Custom Object] Bank Gate With Time

Started by MacTavish, Jul 08, 2015, 06:11 AM

Previous topic - Next topic

MacTavish

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


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

What Fun you need to post screen shot

MacTavish

Quote from: [VSS]Shawn on Jul 08, 2015, 08:34 AMWhat 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

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

Quote from: [VSS]Shawn on Jul 08, 2015, 10:39 AMBro 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

Why use a 1 second infinite timer, when there's onTimeChange(oldHour, oldMin, newHour, newMin)

MacTavish

Quote from: Thijn on Jul 08, 2015, 04:55 PMWhy 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

Seems Good Thanks Works

OFF:Thanks Lasapapu

Sebastian

By the way, these doors are no custom objects. ;)

[VSS]Shawn


Finch Real

Sorry for Bump

Can you post somewhere else?
My Snipet Showroom

http://pastebin.com/5KKuU5cg

KAKAN

Don't use this. There is a system-default object for that door :)
Though, Thijn might host a mirror
oh no

MacTavish


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

Retired VC:MP Player/Scripter :P