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. Forum Support

    3. Suggestions

Mission Coding for Dummies and Pro's!


Recommended Posts


Use the opcodes! Search for them in opcode search mad.gif There's no class for killing yet. For driving, use

Car.DriveTo($car, $x, $y, $z)


Link to comment
Share on other sites

OK but dude he opcode search don't shows exactly what opcodes we want....... anyways 'I will also try to understand more about scm coding ... Its kinda hard

Link to comment
Share on other sites

  • 3 weeks later...

I'm "nitpicking" here...



repeatwait  0 msif 00E1:   player 0 pressed_key 15then              08DA: remove_panel $MENU03E6: remove text boxjump @ENDenduntil 00E1:   player 0 pressed_key 16 



Even though I barely know what that means (I find most of the high-level constructs hard to get my mind around), I assume it's basically this...



:BLKMRKT_DEAL2wait 0if80E1:   not player 0 pressed_key 15else_jump @BLKMRKT_REMOVEPANELSANDPRECHECKif80E1:   not player 0 pressed_key 16else_jump @BLKMRKT_DEAL208D7: [email protected] = panel [email protected] active_rowjump @BLKMRKT_DEALDRUGS



To save threads, complication and time... I like to use (and teach people to use) this instead:



:BLKMRKT_DEAL2wait 0// If player pressed key (Enter)if80E1:   not player 0 pressed_key 15// Then jump to the remove panel thread.else_jump @BLKMRKT_REMOVEPANELSANDPRECHECK// Store the row that is currently selected.08D8: [email protected] = panel [email protected] selected_row// If selected the first row.if8039:   not  [email protected] == 0// Jump to the deal drugs thread.else_jump @BLKMRKT_DEALDRUGS// If selected the second row.if8039:   not  [email protected] == 1// Jump to the deal weapons thread.else_jump @BLKMRKT_DEALWEAPONS// Loop.jump @BLKMRKT_DEAL2


(I even commented my code, just for you! tounge2.gif)


The selected_row opcode only activates once a player selects a row. Thus saving the "if player pressed NUM0 or w/e you're control is" loop (teehee, I used the word "thus"!).


This difference is slight, but it highlights the difference between the two opcodes. One of them can be used to test if a player has pressed the row... And one can be used to see if the player highlighted the row. This is incredibly useful to me during the Black Market mod (it was actually the cause of me discovering these differences... saved my life)... I created a table in which you could press the left and right keys while highlighting an option to change the values of that option. Which was a lifesaver! Before, I had to create double the amount of fxt entries and have the player press a row (which was then highlighted ~y~) before they could change the values.


Anyway... The point is, there is a difference between the 2 opcodes that I think people are missing out on... Big time! And I want people to know it. Instead of ending up like me when I was wondering why my table wasn't working the way I wanted smile.gif



Note to all of you that you have just had your first exclusive preview of the Black Market mod... And to get you excited, everyone who happens to be reading this (only a few of you) I can say this to... IT'S GONNA BE f*ckING GREAT!! tounge2.gif

Edited by Deji
Link to comment
Share on other sites

Deji, you have to keep in mind that this is a tutorial for beginners. If there is a difference between two opcodes and can be used both, doesn't mean that I have to explain that. The method I'm using is a good method, I've used it for every menu I made so far, including all the DYOM menu's. I'm just saying how you CAN do it, of course it doesn't mean that it's the only way.


If they are more advanced, they don't need my tutorial, and they can do it themselves. Then they can go and try things, without using the tutorial. Just like you did.

I keep it simple, only the basics and only one way to do it (most of the time). Just to keep it clear, so nobody will get confused. It's difficult enough without explaining every single opcode that can be used for something.


About your way of commenting it, I just don't think that will make it more organized. wink.gif And about the repeat-wait-until, that is in my opinion the best way to make it, so that's what I explain it in the tutorial.

Link to comment
Share on other sites

What's wrong with the comments?


And the point was that this is more simple than the other method as you don't have to script more wait's...


I'm not saying you have to go into detail about the differences... I just think it's more simple to have that in the code than having to write extra stuff. But I guess if you reckon the other way is easier, that's fine too smile.gif I just think this has to be mentioned somewhere as it lead me to nearly cancel a few of my mods xO

Link to comment
Share on other sites

What's wrong with the comments?

There is nothing wrong with it, I just don't think it is more organized. tounge.gif

Than what?


I'd like to know how my comments could be improved.


What's an example of a good comment? Something more like this?



0000: NOP// Really pointless opcode.0000: NOP// In fact, it doesn't exist.0000:NOP


Link to comment
Share on other sites

Oh, lol, didn't read your post well. I thought you said that you wanted me to make my tutorials with that comments instead of a text. tounge.gif Didn't think that you actually commented a code for me. lol.gif Aaah well, let's go back ontopic, lol.

Link to comment
Share on other sites

Good tutorial, took me 1 hour to read / learn "Actors". biggrin.gif But Sanny hit me up with an error when I wanted to compile the stripped code with a spawned actor...


EDIT: problem solved smile.gif

Edited by Sniputer
Link to comment
Share on other sites

Hey, I've been coding for quite a while (thanks to the Dummies tut)

and I have a request for a tutorial biggrin.gif


You know when you have a special actor go on mission with you

(like Sweet) they follow you and get in your car and have the ability

to swim ect.


I just wondered if you could make a tut on how to code that into

a mission please smile.gif


I used the opcode search, searched this forum, googled it and I couldn't

find anything whatsthat.gif


EDIT: After messing around with random code, I found out how to do it tounge.gif


Edited by d0mm2k8
Link to comment
Share on other sites

HElp guys please!! See in MPACK discussion i founded create folder..,. I can understand we can create and rename the scr.scm but th other text.gxt file! How we create it !? Please help .. Tell me where to get all file for MPACK

Link to comment
Share on other sites


First of all, you can copy the american.gxt to it, then remove all entries and add your own for your MPACK, the .scm is just by compiling a main.scm, create a text document, then when you save it, it it as .dat and you should be set.

Link to comment
Share on other sites

  • 3 weeks later...

Hey, still confused with cutscenes:


- Camera.setposition (X, Y, Z, float, float, float)

I thought those floats are the rotation aren't they? If so, how to use them?


- Camera.pointat (X, Y, Z, mode)

I saw you use opcode to make a camera point, then there was a mode 2, what's it mean? And there are some modes other than mode 2?


- If you don't mind, would you please explain once more about making a simple cutscene (without any spawning actors and anims)?


Thank you!:^:

Link to comment
Share on other sites

  • 5 weeks later...

okay check this i'm hella nubbycake at scripting but i'm gettin the basics down.

and i got a question, i read through almost the whole thing of Dutchy's coding for dummies. .

Went to coding for pros and i noticed the tut script there had a cleo directive in it.

and i'm not to good in modding, but does that mean once you would finish the work, you could put it the cleo folder and have it work in the game after starting a new game?

and have that file to select like the mpack.dat does, but be able to save to???

or would you have to place all your files from the mpackx folder somewhere in the san andreas folder for it to work... could it work ?. . sorry if my question is newb status lol.


oh quick question, can anyone tell me how the hell i can make a text box of players talking to players not just M_PASS crap.

like in a cutscene or somethin have a dude pull up in a car, have my character walk over to him, and have a conversation lmao. does anyone know how i can do this?

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...
  • 2 months later...

you can teleport using sanny builder's coords manager by changing the coords and pressing the set button

Edited by gta_sa_player123
Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...

The tutorial that you have given

is the best tutorial that i have seen ever

thanks for that tutorial,


mercie_blink.gifmercie_blink.gif but, mercie_blink.gif

it was for gta san andreas

and i want to learn about gta vice city colgate.gifcolgate.gif


if the opcode of both game are same & work same

confused.gifconfused.gif then please convert your

small basic mission script (of san andreas )


gta vice city


cryani.gifcryani.gifcryani.gif if opcode are different


can you cryani.gif please cryani.gif make a new tutorial for gta vice city


""if you can't then pls reply me so i will not wait for it"

"& if you can then pls tell me where i will find it"




I AM suicidal.gifsuicidal.gif ORDERING suicidal.gifsuicidal.gif YOU TO MAKE THAT TUTORIAL

PLEASE lol.giflol.gif FORGIVE lol.gif ME




T # @ /\/ K & 4 R {- @ !) ! /\/ G

Link to comment
Share on other sites

Its the same for VC, just that VC ahs a few diferent opcodes. But the structure is the same. But if you dont know english, you wont learn coding.
Link to comment
Share on other sites

But if you dont know english, you wont learn coding.


i know english but i'am not perfect in it.

what about converting of small mission script ?

Link to comment
Share on other sites

023C: load_special_actor 'CAT' as 1 // models 290-299


models 290-299 > What does it mean?

It means you can load special actors to 9 actors.


All peds can be loaded by loading ide files.








But special actors like OGLOC, Ceaser , Truth etc... must load with this.



023C: load_special_actor 'OGLOC' as 1 // models 290-299



Special actor loading has limit. You can only load 9 actors.


[email protected]

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

  • 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.