DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CreateLight()

static ScriptedLightBase EntityLightSource::CreateLight ( typename name ,
vector global_pos = "0 0 0",
float fade_in_time_in_s = 0 )
inlinestaticprivate

Creates an instance of light on the given position. Optionally, use fade_in_time_in_s parameter to make the light fade into existence.

См. определение в файле ScriptedLightBase.c строка 227

228 {
229 ScriptedLightBase light_instance;
230
231 if ( !g_Game.IsServer() || !g_Game.IsMultiplayer() ) // Client side
232 {
233 light_instance = ScriptedLightBase.Cast( g_Game.CreateObject(name.ToString(), global_pos, true) );
234
235 if (!light_instance)
236 {
237 Error("Error! Light entity of name " + name.ToString() + " cannot be spawned! This name is incorrect or not inherited from ScriptedLightBase." );
238 return null;
239 }
240
241 if (fade_in_time_in_s != 0)
242 {
243 light_instance.FadeIn(fade_in_time_in_s);
244 }
245 }
246 else // Server side
247 {
248 if ( g_Game.IsDebug() )
249 {
250 Error("An instance of ScriptedLightBase was attempted to spawn on server side! Lights are CLIENT SIDE ONLY!");
251 }
252 }
253
254 return light_instance;
255 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Определения DayZGame.c:4074
void ScriptedLightBase()
Constructor. Everything here is executed before the constructor of all children.
Определения ScriptedLightBase.c:47
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки Error(), g_Game, name и ScriptedLightBase().