Jump to content

zombies


shiyou

Recommended Posts

this is what i did :

those zombie 01,02,03,04 were first normal peds but i renamed them to zombie 01 02 03 04 because i wanted them as special actors

now the problem is that my game crash when i go near the location where the zombies shud spawn

so i ask u guys to check what i did wrong and correct it

pls dont flame me bcoz im fairly new to these stuffs

heres the code

 

//-------------MAIN---------------thread 'ZOMBIE_THREAD' :ZOMBIE_THREAD_19wait 0 if   Player.Defined($PLAYER_CHAR)jf @ZOMBIE_THREAD_19 if  $ONMISSION == 0 jf @ZOMBIE_THREAD_19 if 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -1919.485 700.3143 46.5625 radius 100.5 100.5 50.5 jf @ZOMBIE_THREAD_19 023C: load_special_actor 'ZOMBIE01' as 6 // models 290-299023C: load_special_actor 'ZOMBIE02' as 7 // models 290-299 023C: load_special_actor 'ZOMBIE03' as 8 // models 290-299 023C: load_special_actor 'ZOMBIE04' as 9 // models 290-299  :ZOMBIE_THREAD_123wait 0 if   Model.Available(#SPECIAL06)  Model.Available(#SPECIAL07)  Model.Available(#SPECIAL08)  Model.Available(#SPECIAL09)jf @ZOMBIE_THREAD_123 1@ = Actor.Create(Mission1, #SPECIAL06, -1939.041, 639.6016, 46.5625)2@ = Actor.Create(Mission1, #SPECIAL07, -1938.041, 638.6016, 46.5625)3@ = Actor.Create(Mission1, #SPECIAL08, -1937.041, 637.6016, 46.5625)4@ = Actor.Create(Mission1, #SPECIAL09, -1936.041, 636.6016, 46.5625)Actor.Angle(1@) = 347.2881Actor.Health(1@) = 3000Actor.Angle(2@) = 347.2881Actor.Health(2@) = 3000Actor.Angle(3@) = 347.2881Actor.Health(3@) = 3000Actor.Angle(4@) = 347.2881Actor.Health(4@) = 30000446: set_actor 1@ immune_to_headshots 0 0332: set_actor 1@ bleeding 1 04D8: set_actor 1@ drowns_in_water 0 0946: set_actor 1@ actions_uninterupted_by_weapon_fire 1 0245: set_actor 1@ walk_style_to "OLDMAN" 03FE: set_actor 1@ money 1200 05E2: AS_actor 1@ kill_actor $PLAYER_ACTOR0446: set_actor 2@ immune_to_headshots 0 0332: set_actor 2@ bleeding 1 04D8: set_actor 2@ drowns_in_water 0 0946: set_actor 2@ actions_uninterupted_by_weapon_fire 1 0245: set_actor 2@ walk_style_to "OLDMAN" 03FE: set_actor 2@ money 1200 05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR 0446: set_actor 3@ immune_to_headshots 0 0332: set_actor 3@ bleeding 1 04D8: set_actor 3@ drowns_in_water 0 0946: set_actor 3@ actions_uninterupted_by_weapon_fire 1 0245: set_actor 3@ walk_style_to "OLDMAN" 03FE: set_actor 3@ money 1200 05E2: AS_actor 3@ kill_actor $PLAYER_ACTOR 0446: set_actor 4@ immune_to_headshots 0 0332: set_actor 4@ bleeding 1 04D8: set_actor 4@ drowns_in_water 0 0946: set_actor 4@ actions_uninterupted_by_weapon_fire 1 0245: set_actor 4@ walk_style_to "OLDMAN" 03FE: set_actor 4@ money 1200 05E2: AS_actor 4@ kill_actor $PLAYER_ACTOR  $ZOMBIE01_ACTOR = Actor.Health(1@)$ZOMBIE01_ACTOR /= 40 $ZOMBIE02_ACTOR = Actor.Health(2@)$ZOMBIE02_ACTOR /= 40 $ZOMBIE03_ACTOR = Actor.Health(3@)$ZOMBIE03_ACTOR /= 40 $ZOMBIE04_ACTOR = Actor.Health(4@)$ZOMBIE04_ACTOR /= 40 Model.Destroy(#SPECIAL06)Model.Destroy(#SPECIAL07)Model.Destroy(#SPECIAL08)Model.Destroy(#SPECIAL09):ZOMBIE_THREAD_294wait 0 if   Player.Defined($PLAYER_CHAR)jf @ZOMBIE_THREAD_383 if   not Actor.Dead(1@)jf @ZOMBIE_THREAD_400 if 00F2:   actor $PLAYER_ACTOR near_actor 1@ radius 200.0 200.0 0 $ZOMBIE01_ACTOR = Actor.Health(1@)$ZOMBIE01_ACTOR /= 25 $ZOMBIE02_ACTOR = Actor.Health(2@)$ZOMBIE02_ACTOR /= 25 $ZOMBIE03_ACTOR = Actor.Health(3@)$ZOMBIE03_ACTOR /= 25 $ZOMBIE04_ACTOR = Actor.Health(4@)$ZOMBIE04_ACTOR /= 25 jf @ZOMBIE_THREAD_383 jump @ZOMBIE_THREAD_294 :ZOMBIE_THREAD_383Actor.RemoveReferences(1@)Actor.RemoveReferences(2@)Actor.RemoveReferences(3@)Actor.RemoveReferences(4@)jump @ZOMBIE_THREAD_19 :ZOMBIE_THREAD_400           Actor.RemoveReferences(1@)Actor.RemoveReferences(2@)Actor.RemoveReferences(3@)Actor.RemoveReferences(4@)end_thread 

 

 

 

 

 

Link to comment
https://gtaforums.com/topic/395632-zombies/
Share on other sites

 

this is what i did :

those zombie 01,02,03,04 were first normal peds but i renamed them to zombie 01 02 03 04 because i wanted them as special actors

now the problem is that my game crash when i go near the location where the zombies shud spawn

so i ask u guys to check what i did wrong and correct it

pls dont flame me bcoz im fairly new to these stuffs

heres the code

 

By more than one condition in a conditional check you have to determine if it means

if AND or if OR

 

 

if  and//------------------------<<- it should be and Model.Available(#SPECIAL06) Model.Available(#SPECIAL07) Model.Available(#SPECIAL08) Model.Available(#SPECIAL09)jf @ZOMBIE_THREAD_123

 

Link to comment
https://gtaforums.com/topic/395632-zombies/#findComment-1058932077
Share on other sites

 

will it work then? i personaly its not working bcoz i renamed them? or i loaded the wrong model?

Sorry, I forgot.

Special actors needs other codes for the load check:

 

if  and023D: special_actor 6 loaded 023D: special_actor 7 loaded 023D: special_actor 8 loaded023D: special_actor 9 loaded jf @ZOMBIE_THREAD_123

 

Link to comment
https://gtaforums.com/topic/395632-zombies/#findComment-1058932870
Share on other sites

Dont use Global Variables. Use locals.

 

 

$ZOMBIE01_ACTOR = Actor.Health(1@)$ZOMBIE01_ACTOR /= 40 $ZOMBIE02_ACTOR = Actor.Health(2@)$ZOMBIE02_ACTOR /= 40 $ZOMBIE03_ACTOR = Actor.Health(3@)$ZOMBIE03_ACTOR /= 40 $ZOMBIE04_ACTOR = Actor.Health(4@)$ZOMBIE04_ACTOR /= 40 

 

 

That will crash, you never created thouse zombies. Change their varaibles to the locals you did create.

Link to comment
https://gtaforums.com/topic/395632-zombies/#findComment-1058933900
Share on other sites

Dont use Global Variables. Use locals.

 

 

$ZOMBIE01_ACTOR = Actor.Health(1@)$ZOMBIE01_ACTOR /= 40 $ZOMBIE02_ACTOR = Actor.Health(2@)$ZOMBIE02_ACTOR /= 40 $ZOMBIE03_ACTOR = Actor.Health(3@)$ZOMBIE03_ACTOR /= 40 $ZOMBIE04_ACTOR = Actor.Health(4@)$ZOMBIE04_ACTOR /= 40 

 

 

That will crash, you never created thouse zombies. Change their varaibles to the locals you did create.

sorry im very noob, but how do i do local?

Link to comment
https://gtaforums.com/topic/395632-zombies/#findComment-1058935417
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.