Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

what is wrong with this code?


texeon
 Share

Recommended Posts

Okay so basically I am trying to spawn dead peds, its working, and I'm spawning the dead cops, multiple to be exact, but when it comes to actually defining multiple different peds, it doesn't work, i'm following a little tut, and basically its still not helping, tell me what I am doing wrong plz.

 

Model.Load(#COP)

009A: [email protected] = create_actor_pedtype 1 model #COP at 1128.688 -698.6875 14.1875

0223: [email protected] = set_actor $COP health_to 0

0332: [email protected] = set_actor $COP bleeding_to 1

Actor.Angle([email protected]) = 450.0

0249: release_model #COP

 

Model.Load(#SWAT)

009A: [email protected] = create_actor_pedtype 2 model #SWAT at 1131.688 -700.6875 14.1875

0223: [email protected] = set_actor $SWAT health_to 0

0332: [email protected] = set_actor $SWAT bleeding_to 1

Actor.Angle([email protected]) = 147.0

0249: release_model #SWAT

 

Model.Load(#SWAT)

009A: [email protected] = create_actor_pedtype 2 model #SWAT at 1125.688 -692.6875 14.1875

0223: [email protected] = set_actor $SWAT health_to 0

0332: [email protected] = set_actor $SWAT bleeding_to 1

Actor.Angle([email protected]) = 724.0

0249: release_model #SWAT

 

Model.Load(#SWAT)

009A: [email protected] = create_actor_pedtype 2 model #SWAT at 1122.688 -693.6875 14.1875

0223: [email protected] = set_actor $SWAT health_to 0

0332: [email protected] = set_actor $SWAT bleeding_to 1

Actor.Angle([email protected]) = 162.0

0249: release_model #SWAT

 

Model.Load(#FBI)

009A: [email protected] = create_actor_pedtype 3 model #FBI at 11223.688 -687.6875 14.1875

0223: [email protected] = set_actor $FBI health_to 0

0332: [email protected] = set_actor $FBI bleeding_to 1

Actor.Angle([email protected]) = 538.0

0249: release_model #FBI

 

Model.Load(#SWAT)

009A: [email protected] = create_actor_pedtype 2 model #SWAT at 1138.688 -694.6875 14.1875

0223: [email protected] = set_actor $SWAT health_to 0

0332: [email protected] = set_actor $SWAT bleeding_to 1

Actor.Angle([email protected]) = 396.0

0249: release_model #COP

 

009A: [email protected] = create_actor_pedtype 1 model #COP at 1129.688 -691.6875 14.1875

0223: [email protected] = set_actor $COP health_to 0

0332: [email protected] = set_actor $COP bleeding_to 1

Actor.Angle([email protected]) = 869.0

0249: release_model #COP

 

 

 

also I encased it into a thread afterwards

 

so it looks like this:

 

create_thread @deadpedspawn (initialising the thread before hand)

 

:deadpedspawn

 

code goes here

 

end_thread

 

I've tried changing the variables: $SWAT1, $SWAT2 so on.

 

I've also found that the more correct I am with the syntax the better the game loads, usually I get straight to the menu in less than a quarter of a second from the main logo screen if it is correct.

 

Please help

Link to comment
Share on other sites

a.use CODE button above...........about here^

well, at least when you write a post

b.make all the pedtypes 4(i dont think its necessary, but i think its better than 1 = player)

c.stop releasing all the models after every ped

put the release model in the end of it

d.

0223: [email protected] = set_actor $COP health_to 00332: [email protected] = set_actor $COP bleeding_to 1

 

you used the wrong variables

e.you also used the wrong syntax, same context as above

 

 

Model.Load(#SWAT)009A: [email protected] = create_actor_pedtype 2 model #SWAT at 1138.688 -694.6875 14.18750223: [email protected] = set_actor $SWAT health_to 00332: [email protected] = set_actor $SWAT bleeding_to 1Actor.Angle([email protected]) = 396.00249: release_model #COP

 

 

here you released the cop model instead of swat

and in the next part

 

 

009A: [email protected] = create_actor_pedtype 1 model #COP at 1129.688 -691.6875 14.18750223: [email protected] = set_actor $COP health_to 00332: [email protected] = set_actor $COP bleeding_to 1Actor.Angle([email protected]) = 869.00249: release_model #COP 

 

 

you didnt even load the model

 

overview:

the script should be like this:

 

 

:deadpedspawnthread 'deadpeds'wait 0Model.Load(#COP)Model.Load(#SWAT)Model.Load(#FBI)if andmodel.available(#COP)model.available(#SWAT)model.available(#FBI)jf @deadpedspawn009A: [email protected] = create_actor_pedtype 4 model #COP at 1128.688 -698.6875 14.18750223: set_actor [email protected] health_to 00332: set_actor [email protected] bleeding_to 1Actor.Angle([email protected]) = 450.0009A: [email protected] = create_actor_pedtype 4 model #SWAT at 1131.688 -700.6875 14.18750223: set_actor [email protected] health_to 00332: set_actor [email protected] bleeding_to 1Actor.Angle([email protected]) = 147.0009A: [email protected] = create_actor_pedtype 4 model #SWAT at 1125.688 -692.6875 14.18750223: set_actor [email protected] health_to 00332: set_actor [email protected] bleeding_to 1Actor.Angle([email protected]) = 724.0009A: [email protected] = create_actor_pedtype 4 model #SWAT at 1122.688 -693.6875 14.18750223: set_actor [email protected] health_to 00332: set_actor [email protected] bleeding_to 1Actor.Angle([email protected]) = 162.0009A: [email protected] = create_actor_pedtype 4 model #FBI at 11223.688 -687.6875 14.18750223: set_actor [email protected] health_to 00332: set_actor [email protected] bleeding_to 1Actor.Angle([email protected]) = 538.0009A: [email protected] = create_actor_pedtype 4 model #SWAT at 1138.688 -694.6875 14.18750223: set_actor [email protected] health_to 00332: set_actor [email protected] bleeding_to 1Actor.Angle([email protected]) = 396.0009A: [email protected] = create_actor_pedtype 4 model #COP at 1129.688 -691.6875 14.18750223: set_actor [email protected] health_to 00332: set_actor [email protected] bleeding_to 1Actor.Angle([email protected]) = 869.00249: release_model #COP0249: release_model #SWAT0249: release_model #FBI

 

Link to comment
Share on other sites

Thank you for your help, but just realize that I did start coding this morning, so I liked how you helped but the criticism didn't seem constructive rather instead it felt you were on the verge of biting my head off.

 

Lol, sorry but in the end the code didn't work, it was close, as it loaded fast, but I got an exception.

 

this is what worked for me:

 

:deadped

thread 'deadped'

wait 0

Model.Load(#COP)

Model.Load(#SWAT)

Model.Load(#FBI)

if and

model.available(#COP)

model.available(#SWAT)

model.available(#FBI)

jf @deadped

009A: [email protected] = create_actor_pedtype >>> 4 <<< model #COP at 1128.688 -698.6875 14.1875

0223: set_actor [email protected] health_to 0

0332: set_actor [email protected] bleeding_to 1

Actor.Angle([email protected]) = 450.0

009A: [email protected] = create_actor_pedtype >>> 4 <<< model #SWAT at 1131.688 -700.6875 14.1875

0223: set_actor [email protected] health_to 0

0332: set_actor [email protected] bleeding_to 1

Actor.Angle([email protected]) = 147.0

009A: [email protected] = create_actor_pedtype >>> 4 <<< model #SWAT at 1125.688 -692.6875 14.1875

0223: set_actor [email protected] health_to 0

0332: set_actor [email protected] bleeding_to 1

Actor.Angle([email protected]) = 724.0

009A: [email protected] = create_actor_pedtype >>> 4 <<< model #SWAT at 1122.688 -693.6875 14.1875

0223: set_actor [email protected] health_to 0

0332: set_actor [email protected] bleeding_to 1

Actor.Angle([email protected]) = 162.0

009A: [email protected] = create_actor_pedtype >>> 4 <<< model #FBI at 11223.688 -687.6875 14.1875

0223: set_actor [email protected] health_to 0

0332: set_actor [email protected] bleeding_to 1

Actor.Angle([email protected]) = 538.0

 

 

009A: >>>>>>>>>>> 3 <<<<<<<<< @ = create_actor_pedtype 2 model #SWAT at

 

 

1138.688 -694.6875 14.1875

0223: set_actor >>>>>>>>>>>> [email protected] <<<<<<<<<<<<<<<<<<, health_to 0

0332: set_actor >>>>>>>>>>>>>> [email protected] <<<<<<<<<<<<<<<<<<<<<< bleeding_to 1

Actor.Angle([email protected]) = 396.0

009A: [email protected] = create_actor_pedtype 1 model #COP at 1129.688 -691.6875 14.1875

0223: set_actor [email protected] health_to 0

0332: set_actor [email protected] bleeding_to 1

Actor.Angle([email protected]) = 869.0

0249: release_model #COP

0249: release_model #SWAT

0249: release_model #FBI

 

Thanks again, because now it is working!

Edited by texeon
Link to comment
Share on other sites

dont worry, i dont like to bite ppl's head off

mainly because everyone on GTAF would like to bite MY head off tounge.gif

anyway. again, use the "CODE" button above, it makes it easier to read your script

glad i could help, even though my script didnt work, what was the problem with it?

and how is it working with that?

 

009A: >>>>>>>>>>> 3 <<<<<<<<< @ = create_actor_pedtype 2 model #SWAT at 

 

if you used [email protected], then local variable [email protected] doesnt exist

which would cause a crash because of that

 

0223: set_actor >>>>>>>>>>>> [email protected] <<<<<<<<<<<<<<<<<<, health_to 00332: set_actor >>>>>>>>>>>>>> [email protected] <<<<<<<<<<<<<<<<<<<<<< bleeding_to 1Actor.Angle([email protected]) = 396.0

 

well, whatever tounge.gif, its working, thats all that matters...isnt it?

Link to comment
Share on other sites

thank you again, and soz I seemed like an asshole after my edit, the code with the >>>>>>> was to signify the problem, one reason why it didn't work is with the identifiers, like: [email protected], [email protected] so on, you had a [email protected] in the [email protected] column and it chucked a mental, next all the models had been specified as cops, as this actually still worked, i think to prevent issues I change it so it was for the correct model, but hey, who gives a sh*t.

 

Also yes I need to start using the code box, helps people to understand.

 

You did a great and quick job, so it is easy to overlook, I even overlooked the identifier error and the model specifying.

 

Maybe when I get better (quickly) we could work together.

 

Thanks!

Link to comment
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
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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