Универсальный солдат
Этот скрипт добавляет в ряды полиции универсальных солдат. В отличии от обычных полицейских ботов
УС имеют некоторое подобие ИИ: они могут стрейфиться, а так же использовать различное
оружие в разных ситуациях. Вобщем, сотрите сами.
:Thread
thread "UNIVERSAL_SOLDIER"
var
1@ : Actor
5@ : Marker
7@ : Integer
end
:Universal_Soldier_Check1
wait 0
if and
#SWAT.Available
#M4.Available
#SHOTGSPA.Available
#KNIFECUR.Available
#HEATSEEK.Available
jf @Universal_Soldier_Check1
1@.Create(Special, #SWAT, 2@, 3@, 4@)
1@.Health = 1500
1@.Armour = 1500
5@.CreateAboveActor(1@)
0446: toggle_actor 1@ immune_to_headshots 0
01B2: give_actor 1@ weapon 31 ammo -1 // Load the weapon model before using this
01B2: give_actor 1@ weapon 27 ammo -1 // Load the weapon model before using this
01B2: give_actor 1@ weapon 36 ammo -1 // Load the weapon model before using this
01B2: give_actor 1@ weapon 4 ammo -1 // Load the weapon model before using this
087E: toggle_actor 1@ weapon_droppable 0
02E2: set_actor 1@ weapon_accuracy_to 95
081A: set_actor 1@ weapon_skill_to 2
060A: create_decision_maker_type 0 store_to 8@ // decisionallowedm_.ped files
060B: set_actor 1@ decision_maker_to 8@
077A: set_actor 1@ default_action 4 to_actors_pedtype 0
07A5: AS_actor 1@ attack_actor $PLAYER_ACTOR -1 ms
#SWAT.Destroy
#M4.Destroy
#SHOTGSPA.Destroy
#KNIFECUR.Destroy
#HEATSEEK.Destroy
:Universal_Soldier_AI
wait 0 ms
if or
not Player.Defined($PLAYER_CHAR)
1@.Dead
then
5@.Disable
1@.RemoveReferences
065C: release_decision_maker 8@
wait 10000 ms
jump @Universal_Soldier
end
if or
Actor.Driving($PLAYER_ACTOR)
Actor.DrivingPlane($PLAYER_ACTOR)
then
01B9: set_actor 1@ armed_weapon_to 36
07A5: AS_actor 1@ attack_actor $PLAYER_ACTOR -1 ms
else
if
0104: actor $PLAYER_ACTOR near_actor 1@ radius 50.0 50.0 50.0 sphere 0
then
01B9: set_actor 1@ armed_weapon_to 31
end
if
0104: actor $PLAYER_ACTOR near_actor 1@ radius 10.0 10.0 10.0 sphere 0
then
01B9: set_actor 1@ armed_weapon_to 27
end
if
0104: actor $PLAYER_ACTOR near_actor 1@ radius 2.5 2.5 2.5 sphere 0
then
01B9: set_actor 1@ armed_weapon_to 4
end
end
if and
0457: player $PLAYER_CHAR aiming_at_actor 1@
82D8: not actor 1@ current_weapon == 4
874F: not actor $PLAYER_ACTOR ped_event == 12
then
7@ = Random(-1, 1)
077C: clear_actor 1@ default_action 4 to_all_actor_types
9@ = Actor.Angle($PLAYER_ACTOR)
000F: 9@ -= 180.0
1@.Angle = 9@
06E3: AS_actor 1@ roll_sideways 7@
wait 1000
077A: set_actor 1@ default_action 4 to_actors_pedtype 0
07A5: AS_actor 1@ attack_actor $PLAYER_ACTOR -1 ms
wait 500
end
jump @Universal_Soldier_AI