RU/setMinuteDuration: Difference between revisions
Jump to navigation
Jump to search
(Created page with '__NOTOC__ {{RU/Server client function}} Устанавливает продолжительность минуты в игре. В GTA изначально равна 1000. ==И…') |
No edit summary |
||
Line 56: | Line 56: | ||
</section> | </section> | ||
== | ==Смотри также== | ||
{{World_functions}} | {{RU/World_functions}} | ||
[[en:setMinuteDuration]] | [[en:setMinuteDuration]] |
Revision as of 09:16, 8 March 2010
Устанавливает продолжительность минуты в игре. В GTA изначально равна 1000.
Использование
bool setMinuteDuration ( int milliseconds )
Необходимые параметры
- milliseconds: новая продолжительность игровой минуты.
Что возвращается
Возвращается true, если изменение успешно произошло, или false, если изменение не произошло.
Пример
This example will make the ingame time correspond to the real-world time of the server.
Click to collapse [-]
Серверfunction syncRealTime(player) -- get the current real time and send it to the player local realtime = getRealTime() triggerClientEvent(player, "doSyncRealTime", getRootElement(), realtime.hour, realtime.minute) end function resourceStart() -- when the resource starts, send the real time to all players currently in the server local players = getElementsByType("player") for i,player in ipairs(players) do syncRealTime(player) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), resourceStart) function playerJoin() -- send the real time to joining players syncRealTime(source) end addEventHandler("onPlayerJoin", getRootElement(), playerJoin)
Click to collapse [-]
Clientfunction syncRealTime(h, m) -- set the ingame time setTime(h, m) -- make ingame time progress at the same rate as real time (60 seconds per minute) setMinuteDuration(60000) end -- attach the above function to the doSyncRealTime event addEvent("doSyncRealTime", true) addEventHandler("doSyncRealTime", getRootElement(), syncRealTime)
Смотри также
- areTrafficLightsLocked
- getCloudsEnabled
- getGameSpeed
- getGravity
- getHeatHaze
- getJetpackMaxHeight
- getMinuteDuration
- getSkyGradient
- getTime
- getTrafficLightState
- getVehiclesLODDistance
- getWeather
- getZoneName
- isGarageOpen
- resetSkyGradient
- resetHeatHaze
- setCloudsEnabled
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setMinuteDuration
- setSkyGradient
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setVehiclesLODDistance
- setWeather
- setWeatherBlended
- setInteriorSoundsEnabled
- getInteriorSoundsEnabled
- setRainLevel
- getRainLevel
- resetRainLevel
- setSunSize
- getSunSize
- resetSunSize
- setSunColor
- getSunColor
- resetSunColor
- setWindVelocity
- getWindVelocity
- resetWindVelocity
- setFarClipDistance
- getFarClipDistance
- resetFarClipDistance
- setFogDistance
- getFogDistance
- resetFogDistance
- removeWorldModel
- restoreWorldModel
- restoreAllWorldModels
- setOcclusionsEnabled
- getOcclusionsEnabled
- setJetpackWeaponEnabled
- getJetpackWeaponEnabled
- setAircraftMaxVelocity
- getAircraftMaxVelocity
- setMoonSize
- getMoonSize
- resetMoonSize