shiyou Posted February 1, 2009 Share Posted February 1, 2009 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 More sharing options...
ZAZ Posted February 1, 2009 Share Posted February 1, 2009 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 More sharing options...
shiyou Posted February 1, 2009 Author Share Posted February 1, 2009 (edited) will it work then? i personaly its not working bcoz i renamed them? or i loaded the wrong model? Edited February 1, 2009 by shiyou Link to comment https://gtaforums.com/topic/395632-zombies/#findComment-1058932319 Share on other sites More sharing options...
ZAZ Posted February 1, 2009 Share Posted February 1, 2009 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 More sharing options...
coin-god Posted February 2, 2009 Share Posted February 2, 2009 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 More sharing options...
shiyou Posted February 2, 2009 Author Share Posted February 2, 2009 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 More sharing options...
cj360 Posted February 2, 2009 Share Posted February 2, 2009 locals are 0@ through 33@ globals are anything with a $ like $car1 is a global. So replace $ZOMBIE01_ACTOR with 1@ and so on. Link to comment https://gtaforums.com/topic/395632-zombies/#findComment-1058936056 Share on other sites More sharing options...
shiyou Posted February 2, 2009 Author Share Posted February 2, 2009 locals are 0@ through 33@ globals are anything with a $ like $car1 is a global.So replace $ZOMBIE01_ACTOR with 1@ and so on. ok thx Link to comment https://gtaforums.com/topic/395632-zombies/#findComment-1058936321 Share on other sites More sharing options...
shiyou Posted February 2, 2009 Author Share Posted February 2, 2009 oopsie Link to comment https://gtaforums.com/topic/395632-zombies/#findComment-1058936365 Share on other sites More sharing options...
james227uk Posted February 3, 2009 Share Posted February 3, 2009 In terminology (or whatever the word its ) there are 33 locals for a script. But only 31 of them can be used for normal use. 32 and 33 are timers Link to comment https://gtaforums.com/topic/395632-zombies/#findComment-1058937708 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now