dertyjerzian Posted February 11, 2007 Share Posted February 11, 2007 Welp, you dont see me in these parts very often But I really can't stand not knowing how to play with the SCM. For starters, I've used SAMB before, for this one edit, and now I use Sanny Builder, it seems like it is the most active program. If I should use another, I shall switch. But... My problem lies here: All I want to do make my bullet hot pink with a brown racing stripe. I am using Steve-M's stripped script and have changed HYDRA to BULLET. Works and I am happy, now I would like to have my bullet pink with a brown racing stripe lol. Here is all of the code that may be needed: :MAIN_383wait 0 if Model.Available(#BULLET)else_jump @MAIN_383 $4 = Car.Create(#BULLET, $7, $6, $5)036A: put_actor $PLAYER_ACTOR in_car $4fade 1 1000 wait 100 03E6: remove_text_box :MAIN_441wait 2500 jump @MAIN_441 If you know Steve's script, then you know that 7 6 and 5 are coords, 0,0,30. Changed that to 13 (to spawn on the 12.0 ground in my map) workd, and I am happy. Now the car color issue. I add: :MAIN_383wait 0 if Model.Available(#BULLET)else_jump @MAIN_383 $4 = Car.Create(#BULLET, $7, $6, $5)0229: set_car 4@ color_to 126 44036A: put_actor $PLAYER_ACTOR in_car $4fade 1 1000 wait 100 03E6: remove_text_box :MAIN_441wait 2500 jump @MAIN_441 Now, I know the ide says do not use hot pink or whatever, but I always have and I like it, it doesnt have any adverse effect that I can see. I really want to learn some coding. Why doesnt this work, guys? this same edit worked in SAMB, unless my memory has caused me to put the code into the wrong place? Link to comment https://gtaforums.com/topic/267020-maybe-theres-help-these-days-d/ Share on other sites More sharing options...
Bigun Posted February 11, 2007 Share Posted February 11, 2007 Very simple error. If you've read some basic introductory coding tutorials, you'd spot it. Bad! $4 = Car.Create(#BULLET, $7, $6, $5)0229: set_car 4@ color_to 126 44 As you can see and figured, the car is created and a reference to it is stored in the variable $4. Now, the '$' indicates it is a global variable. $4 and 4@ are NOT the same (the latter being a local var); hence when you try to set 4@'s color, it crashes because that variable doesn't reference a car. You need to use the correct $4 instead. Now, I realize this is also in steve's script and shouldn't matter much for a stripped script, but you don't need to use globals there (you don't even need vars for the coordinates, though he made it that way for convienence), use local vars instead (@0 - @31, can't use @32+@33 which are timers). And if you're already using global vars, name them (like the $SpawnX vars); using numbers only in global vars uses DMA offset which basically decides the offset to store the variable at; rather, just use a name and the builder will pick a free offset at the end of the file. Link to comment https://gtaforums.com/topic/267020-maybe-theres-help-these-days-d/#findComment-4046857 Share on other sites More sharing options...
dertyjerzian Posted February 12, 2007 Author Share Posted February 12, 2007 wow bigun, thank u i totally missed that teaching.On this occasion I guess I mimiced original SA code toooo close The tutorials never did great for me, bigun. I'm glad you're around Link to comment https://gtaforums.com/topic/267020-maybe-theres-help-these-days-d/#findComment-4047806 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