Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (85,344 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

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

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

    2. Site Suggestions

l3mmy

Scripting Tutorials

Recommended Posts

l3mmy

Ok, i thought i'd make this to make it Easyer for people to find what they need scripting wise, i will add a Few San Andreas Opcodes for you to Chew on for now smile.gif

 

$2 is Equal to $PLAYER_CHAR

 

Lets Make the Player Appear 'Drunk' Like i was when i posted tounge.gif

 

052C: set_player $PLAYER_CHAR drunk_visuals  100

 

 

CellPhone Animations

 

0247: request_model #CELLPHONE;Get the Cellphone0729: unknown_action_sequence $PLAYER_ACTOR 1;Start Mobile Call0729: unknown_action_sequence $PLAYER_ACTOR 0;End Mobile Call0249: release_model #CELLPHONE

 

As you can See, the 0729: lines are the Same, apart from the 1 and the 0, 1 is to turn it on and 0 is to turn it off smile.gif Try them

 

Now, How about giving the Player a Jetpack.

 

07A7: put_jetpack_on_actor $PLAYER_ACTOR

 

 

Keep your Weapons etc after you are Killed/Arrested:

 

08DE: keep_stuff_after_busted 0 (0=on/1=off)08DD: keep_stuff_after_wasted 0 (0=on/1=off)

 

 

Ok, Let's Move on.

 

Now we will Create a Marker, and make it Detect the Player, if the Player is In the Area, he will get $10,000 every few seconds.

 

Add

 

 

02A7: $439 = create_icon_marker_and_sphere $441 at X Y Z

 

Replace X Y and Z with your Own Co ords (this is where the Marker will be)

to the Bottom of Main, Then add

 

004F: create_thread ££CASH_1 

 

underneath that.

 

Then add this to the Bottom of the Script.

 

 

:CASH_10001: wait  250 ms00D6: if  000ED:   actor $3 0 ()near_point_on_foot X Y radius  4.0  4.0004D: jump_if_false ££CASH_10109: player $2 money +=  10000   0001: wait 5000 ms0002: jump ££CASH_1

 

 

Replace X and Y with your X and Y Co ordinates from the Game.

 

Now Let Me Explain a Little colgate.gif.

 

The 0001: wait * ms is How long to Wait Before (re)Performing the Action.

 

00ED: actor $3 0 ()near_point_on_foot X Y radius 4.0 4.0 - This Will Check to See if our Player is in the Created Marker, use the Same X and Y Co Ords as your Marker Further Up.

 

0109: player $2 money += 10000 - This will Give your Player $10,000, Replace 10000 with what ever amount you want your Player to Recieve.

 

0001: wait 5000 ms - This will make the Game Wait 5 seconds before giving another $10k. put as 0 for Infinite Loop.

 

I hope this Helped a Few People out. colgate.gif

Share this post


Link to post
Share on other sites
evilrex

thanks for the tutorial, it explained a lot of my questions... though I don't understand where to put the all pieces of script....

Can I put them anywhere in the MAIN.scm file?

 

eg: 052C: set_player $PLAYER_CHAR drunk_visuals 100 <--- where do I put this line?

Share this post


Link to post
Share on other sites
Andrew

The first few parts were explaining about the lines of code. I'd place the marker code within the block of code that sets up markers.

Share this post


Link to post
Share on other sites
plunk89

Thanks for the tut. Its good!

I have a question inconnection with the drunk animation: Can i make a marker that makes the player drunk for 1minute inside a bar or with a key combination pressed?

 

plunk89

Share this post


Link to post
Share on other sites
l3mmy

Sorry fora Late Reply, I'm having internet Problems atm, But anyway...

 

@ evilrex : 052C: set_player $PLAYER_CHAR drunk_visuals 100

I Normally put this Under Main... colgate.gif

 

@ plunk89 : Detect if the Player is in the Area, if he is, then Make him Drunk (add Drunk line with 100, wait 60000ms (i think), then set the Drunk visuals to 0. Should work smile.gif

 

 

 

Share this post


Link to post
Share on other sites
matyassv12

hello, i'm trying to install a steed mod for SA i need help with this :

 

 

 

004F: create_thread ££BIKETH

 

:BIKETH

0001: wait 0 ms

03A4: name_thread "STEED"

 

:BIKE1

0001: wait 127 ms

00D6: if 0

0256: player $PLAYER_CHAR defined

004D: jump_if_false ££BIKE1

00D6: if 0

03EE: player $PLAYER_CHAR controllable

004D: jump_if_false ££BIKE1

00D6: if 0

047A: $PLAYER_ACTOR;; 047A: actor $PLAYER_ACTOR driving_a_motorbike

004D: jump_if_false ££BIKE4

03C0: @0 = actor $PLAYER_ACTOR car

 

:BIKE2

0226: @5 = actor $PLAYER_ACTOR health

0227: @6 = car @0 health

0001: wait 10 ms

00D6: if 0

0256: player $PLAYER_CHAR defined

004D: jump_if_false ££BIKE1

00D6: if 0

82BF: NOT car @0 sunk

004D: jump_if_false ££BIKE3

00D6: if 0

80E1: NOT key_pressed 0 15

004D: jump_if_false ££BIKE3

;00D6: if 0

;8038: NOT $BIKEOFF == 1

;004D: jump_if_false ££BIKE3

00D6: if 0

80DF: NOT actor $PLAYER_ACTOR driving

004D: jump_if_false ££BIKE2

018C: play_sound 1058 at 0.0 0.0 0.0

036A: put_actor $PLAYER_ACTOR in_car @0

0223: set_actor $PLAYER_ACTOR health_to @5

0224: set_car @0 health_to @6

0002: jump ££BIKE2

 

:BIKE3

0001: wait 127 ms

00D6: if 0

0256: player $PLAYER_CHAR defined

004D: jump_if_false ££BIKE1

00D6: if 0

80DF: NOT actor $PLAYER_ACTOR driving

004D: jump_if_false ££BIKE3

01C3: remove_references_to_car @0;; Like turning a car into any random car

0002: jump ££BIKE1

 

:BIKE4

00D6: if 0

80DF: NOT actor $PLAYER_ACTOR driving

004D: jump_if_false ££BIKE1

00D6: if 1

00E1: key_pressed 0 6

00E1: key_pressed 0 8

004D: jump_if_false ££BIKE1

077E: $ACTIVE_INTERIOR = active_interior

00D6: if 0

0038: $ACTIVE_INTERIOR == 0 ;; integer values

004D: jump_if_false ££BIKE1

0172: @4 = actor $PLAYER_ACTOR z_angle

04C4: create_coordinate @1 @2 @3 from_actor $PLAYER_ACTOR offset 0.0 -1.0 -1.0

0247: request_model #NRG500

038B: load_requested_models

 

:BIKELAST

0001: wait 0 ms

00D6: if 0

0248: model #NRG500 available

004D: jump_if_false ££BIKELAST

00A5: @0 = create_car #NRG500 at @1 @2 @3

0175: set_car @0 z_angle_to @4

0249: release_model #NRG500

036A: put_actor $PLAYER_ACTOR in_car @0

04BA: set_car @0 speed_instantly 20.0

01C3: remove_references_to_car @0;; Like turning a car into any random car

0002: jump ££BIKE2

 

 

 

What do i have to do with that... do i have to just paste it at the end of main.scm or what please help

Share this post


Link to post
Share on other sites
Demon86rjc

Where Would You Put scripts In Is There A Order Or Can You Just Put Them Anywhere?

Share this post


Link to post
Share on other sites
CroModder

What is doing "jump_if_false"? blush.gif

Share this post


Link to post
Share on other sites
fantomcat_2k

I have major problems with this mod, i can get the red sphere to spwan outside the johnson house, but no cash marker, and when i stand in the marker, nothing happens.

Can you tell me where to put these lines? I have the spere amrker code just before the mission 1 data, under the police bribe codes, this works, but the rest of the code is at the bottom of the file, where the RC shop data is, and it doesnt work, ive tried to put this data next to the bribe data, (further up the file, but i just get compling errors) can any tell me exactley where to put this code? Also there are 3 bits of code, i no im asking, but can i have 3 locations??

 

Any help on this would be greatly appriciated!!!

Share this post


Link to post
Share on other sites
l3mmy

Yes You can have more than One location..If you want Send me your SCM, and i'll add it for you But i'll need the coordinates. Then i'll return it to you and you can see how it works colgate.gif

 

- L3mmy - [email protected]

Share this post


Link to post
Share on other sites
fantomcat_2k

OK, ive tried again,

 

ive got the full code at the bottom of main, just above mission 0 and i gat nothing, ive had this code working before, but i cant remember where i put it!

 

come on, give me a clue?

 

can you give me maybe a few code boxes with the information, or a screenshot or something?

 

 

Share this post


Link to post
Share on other sites
l3mmy
OK, ive tried again,

 

ive got the full code at the bottom of main, just above mission 0 and i gat nothing, ive had this code working before, but i cant remember where i put it!

come on, give me a clue?

can you give me maybe a few code boxes with the information, or a screenshot or something?

Here is an Example of a Totally Stripped SCM With the Cash Marker Function Added....

 

 

DEFINE VERSION SA 0.330002: jump ££Second_SegmentDEFINE MEMORY  100  ; Equals Mission Builder type global variable range $2 to $24:Second_Segment0002: jump ££Third_SegmentDEFINE OBJECTS  1DEFINE OBJECT WWW.FREEWEBS.COM/L3MMY/                ; This is an unused object. You can put anything here.:Third_Segment0002: jump ££Fourth_SegmentDEFINE MISSIONS  0:Fourth_Segment0002: jump ££Fifth_SegmentDEFINE EXTERNAL_SCRIPTS  0:Fifth_Segment0002: jump ££Sixth_SegmentDEFINE UNKNOWN_FIFTH_SEGMENTDEFINE UNKNOWN1  0:Sixth_Segment0002: jump ££MAIN_1DEFINE UNKNOWN_SIXTH_SEGMENTDEFINE UNKNOWN3  0;-------------MAIN---------------:MAIN_103A4: name_thread 'MAIN'016A: fade  0 ()  0 ms042C: set_total_missions_to  0030D: set_total_mission_points_to  001F0: set_max_wanted_level_to  60111: set_wasted_busted_check_to  0 (disabled)00C0: set_current_time  10  00005: $7 =  -2787.0 ;; floating-point values0005: $6 =  -1113.7 ;; floating-point values0005: $5 =  60.0 ;; floating-point values04E4: unknown_refresh_game_renderer_at $7 $603CB: set_camera $7 $6 $5062A: change_stat  165 (energy) to  999.0 ; float062A: change_stat  23 (muscle) to  999.0 ; float062A: change_stat  21 (fat) to  0.0 ; float062A: change_stat  163 (health upgrade) to  999.0 ; float062A: change_stat  160 (driving skill) to  999.0 ; float062A: change_stat  229 (bike skill) to  999.0 ; float062A: change_stat  223 (pilot skill) to  999.0 ; float062A: change_stat  230 (cycling skill) to  999.0 ; float0629: change_stat  181 (islands unlocked) to  4 ; integer see statdisp.dat0629: change_stat  68 () to  0 ; integer see statdisp.dat0053: $2 = create_player #NULL at $7 $6 $507AF: $11 = player $2 group01F5: $3 = create_emulated_actor_from_player $20373: set_camera_directly_behind_player0173: set_actor $3 z_angle_to  262.001B6: set_weather  1087B: set_player $2 clothes "BBALLJACKRSTAR" "BBJACK"  0 087B: set_player $2 clothes "JEANSDENIM" "JEANS"  2 087B: set_player $2 clothes "SNEAKERBINCBLK" "SNEAKER"  3 087B: set_player $2 clothes "PLAYER_FACE" "HEAD"  1 070D: $2 04BB: select_interior  0 ;; select render area01B4: set_player $2 frozen_state  1 (unfrozen)01B7: release_weather016C: restart_if_wasted at $7 $6 $5 angle  0.0 unknown  0 0247: request_model #HYDRA02A7: $439 = create_icon_marker_and_sphere $441 at 0.0 1.0 2.0;;Replace 0.0 1.0 2.0 with your x, y, z004F: create_thread ££CASH_1:MAIN_390001: wait  0 ms00D6: if  00248:   model #HYDRA available004D: jump_if_false ££MAIN_3900A5: $4 = create_car #HYDRA at $7 $6 $5036A: put_actor $3 in_car $4016A: fade  1 (back)  1000 ms0001: wait  100 ms03E6: remove_text_box:MAIN_480001: wait  2500 ms0002: jump ££MAIN_48:CASH_10001: wait  250 ms;How Long To wait each time (To Prevent infinate loop) 1000 = 1 Second.00D6: if  000ED:   actor $3 0 ()near_point_on_foot X-Coord Y-Coord radius  4.0  4.0004D: jump_if_false ££CASH_10109: player $2 money +=  10000  ;The Player will Recieve $10,0000001: wait 5000 ms0002: jump ££CASH_1

 

Share this post


Link to post
Share on other sites
kevindevil

what progam i need for scrip editing?? blush.gif

Share this post


Link to post
Share on other sites
Spider-Vice

You can use Barton's Mission Builder or Sanny Builder.

Share this post


Link to post
Share on other sites
kevindevil

wich one is better progam??

Share this post


Link to post
Share on other sites
Spider-Vice

It's Barton's one. But if you don't know where to put the code, search by the Tut section.

Share this post


Link to post
Share on other sites
fantomcat_2k

oh, cool i've got it now, thank you so much!!

Share this post


Link to post
Share on other sites
Danoosh Pichgahe

Hi...

 

I want to make a Application

that application can stop a speed of cars or bikes or ...

for exaple you like to driving a car with 50 Km speed (in GTA san andreas) you Enable that Application and after that you can drive a car or ... in same speed.

 

But i don't know how can i making that Application!

1-Help Me for making that application or if you made that please tell me or upload that and after that show the Download Link.

2-if we have a Trainer and with that Trainer ; you can drive a same speed of cars please tell me..

 

>>>>>>>>Sorry I Can not write very good English <<<<<<<<

 

Share this post


Link to post
Share on other sites
Flyingportugueseman

tounge2.gif Those tips are great but i'm kinda new on this stuff so...

Where do I put those codes??? confused.gifblush.gifnotify.gif

 

Much love dog...

LOL icon14.gif

lol.gif

Share this post


Link to post
Share on other sites
l3mmy

Hey, Welcome to the Forums colgate.gif to use this Code you have to download SA Builder (A SCM Editor) and open the script in the san andreas folders..

Share this post


Link to post
Share on other sites
Doctor Emmett L. Brown

Great tutorial thanks hoping to learn more about scripting in the future!

Share this post


Link to post
Share on other sites
cj360

could one use these for cleo scripts for do the main.scm and cleo scripts have diffences that keep you from doing so?

Share this post


Link to post
Share on other sites
l3mmy

I am not sure mate..I never used Cleo myself..

Share this post


Link to post
Share on other sites
oGeesKeeMasK

A'ight, I've nvr really been good at this, the one mission bldr that's left will just about allw ths 2 hppn. I wnt to replace a line in the SAMB,

"EVENT_DRAGGED_OUT_CAR" to something alng the lines of

"EVENT_REMOVED_FROM_CAR" or something in the form of a jack mve by the OGF in San Andreas instead of just "Dragging" the guy out and beating him up, I wnt them to drag him out and take the car. sarcasm.gifcookie.gifmoto_whistle.gif How would I word it?

 

Share this post


Link to post
Share on other sites
Archie_Junior

I want to place a save game icon inside the crack den in idlewood apartments, how do i go about doing that?

Share this post


Link to post
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

×

Important Information

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