DayZ 1.27
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 строка 224

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

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