24 августа 2012 г.

Создаём свет

С помощью этого скрипта можно создать свет, нужно это чисто для интереса, так как сам свет не является особенно качественным.
:Light
wait 0
if
player.Defined(0)
jf @Light
if and
not actor.Dead($PLAYER_ACTOR)
not actor.Driving($PLAYER_ACTOR)
0ADC: test_cheat "LIGHT"
jf @Light
0ACA: show_text_box "Press Action to set the position of the light"
while true
wait 0
   if and
   not actor.Dead($PLAYER_ACTOR)
   not actor.Dead($PLAYER_ACTOR)
   00E1: player 0 pressed_key 4
   then
   actor.StorePos($PLAYER_ACTOR,1@,2@,3@)
   break
   end
end
0ACA: show_text_box "Press Action to set the target of the light"
wait 750
while true
wait 0
   if and
   not actor.Dead($PLAYER_ACTOR)
   not actor.Driving($PLAYER_ACTOR)
   00E1: player 0 pressed_key 4
   then
   actor.StorePos($PLAYER_ACTOR,4@,5@,6@)
   break
   end
end
06B1: $LIGHT = create_searchlight_at 1@ 2@ 3@ radius 0.05 target 4@ 5@ 6@ radius 5.0
0ACA: show_text_box "The light is created. Type 'DIS' to delete it"
repeat
wait 0
until 0ADC: test_cheat "DIS"
06B2: destroy_searchlight $LIGHT
0ACA: show_text_box "Type 'LIGHT' to create a new light"
wait 750
jump @Light

Комментариев нет: