Members Online»
0 Active | 91 Guests
Online:
|
LATEST FORUM THREADS»
by Welshy
Posts: 6 / 374 The Future of MODSonline
In The News by KAZAM3766
Posts: 1 / 633 CoD: Battle Royale
CoD+UO Map + Mod Releases by morgawr
Posts: 1 / 2700 Damaged .pk3's
CoD Mapping by lazygit
Posts: 1 / 3213 heli to attack ai
CoD4 SP Mapping by DrBiggzz
Posts: 11 / 1027 New Cod UO Rifle Mod.
CoD Mapping |
Polls»
|
Zeroy shows us how to create a timer for triggering events
Dragon Rising: Create a Timer for triggering Events
When you add a timer it will count from the start time down to 0 at which point the function onTimer_TIMERNAME(name) becomes usable.
Say you want to have Echelon1 moving from one location to another 5 minutes after your Player and his Fireteam entered triggerzone1:
In the above the timer "timer1" is created when anyone enters triggerzone1, the timer is then display as in "HH:MM:SS" once only (i dont know how to have it permanent and decreasing yet) Note: the disableEvent is so that the Timer isnt created each time someone steps out of the triggerzone (it removes the trigger essentially) Next:
function onEnter_triggerzone1(zoneName, UnitName)
OFP:addTimer("timer1", 300000) -- 300000ms = 5mins
hours, minutes, seconds = OFP: convertTimeToHMS(OFP:getTimer("timer1"));
OFP:displaySystemMessage("The time: " .. hours .. ":" .. minutes .. ":" .. seconds);
OFP:disableEvent("onEnter_triggerzone1")
end
This last bit will spawn and move the Echelon1 to the waypoint when the timer is up. You could also use the timer to end a mission:
function onTimer_timer1(name)
OFP:activateEntitySet("Echelon1")
OFP:move("Echelon1", "waypoint", "ADDTOFRONT")
end
function onTimer_timer1(name)
OFP:setObjectiveState("Objective", "COMPLETED")
OFP:removeTimer("timer1")
OFP:missionCompleted()
end
Latest Syndicated News»
Comments: 5
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which... Comments: 5
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ... Comments: 5
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead?
... Comments: 5
Codutility.com up and runn...
It seems to me the like the site is completely dead? Comments: 5
Codutility.com up and runn...
Yeeaahhhh.........
|
Latest Downloads»
OHMY Don Quixote
Call of Duty 2: Maps: Multiplayer (5.76Mb) OHMY Neuburg
Call of Duty 2: Maps: Multiplayer (6.84Mb) OHMY Tebessa
Call of Duty 2: Maps: Multiplayer (7.36Mb) OHMY POW Camp
Call of Duty 2: Maps: Multiplayer (2.15Mb) OHMY Valley
Call of Duty 2: Maps: Multiplayer (5.7Mb) |
Partners & Friends»
|
Site Links and Information
|
Partners
|
Friends
|
Copyright © MODSonline LLC
Tresware Content Management System © 2011
Website Designed by LKFX and Developed by Tresware