Shinwell_Johnson Posted May 20, 2013 Share Posted May 20, 2013 What code do we use in sanny buldier to make a vehicle spawn at a place? like a hydra at x:123.454 y:3425.53 z:12.333 Link to comment Share on other sites More sharing options...
OrionSR Posted May 20, 2013 Share Posted May 20, 2013 There is more to it than just one code. You should read one of the tutorials provided in the III Coding Directory topic pinned in the III Coding sub-forum. Beware of the codes used to create car generators. They are easier to write but if used incorrectly you can clog up your cargen pool so badly that random cars will no longer spawn. Link to comment Share on other sites More sharing options...
Shinwell_Johnson Posted May 20, 2013 Author Share Posted May 20, 2013 i mean what cleo code do i use to make vehicle spawn at a place? Link to comment Share on other sites More sharing options...
OrionSR Posted May 20, 2013 Share Posted May 20, 2013 The answers you want are in the tutorials. Read them. Link to comment Share on other sites More sharing options...
kramerzz Posted May 20, 2013 Share Posted May 20, 2013 Use this 00A5: $1121 = create_car #DELUXO at -266.811 -302.352 10.2977 The model needs to be loaded first. Link to comment Share on other sites More sharing options...
Node Posted May 20, 2013 Share Posted May 20, 2013 What code do we use in sanny buldier to make a vehicle spawn at a place? like a hydra at x:123.454 y:3425.53 z:12.333 You need load the model like so: 0247: load_model #WBDYG2 Replacing '#WBDYG2' with whatever model you want to load. Then add this line of code below the block of requested models: 038B: load_requested_models Like so: 0247: load_model #WBDYG2038B: load_requested_models or: 0247: load_model #WBDYG20247: load_model #WBDYG20247: load_model #WBDYG20247: load_model #WBDYG2038B: load_requested_models You can also check if the models have been loaded, although this isn't mandatory. To do this, use this code: :1wait 0if0248: model #WBDYG2 available jf @1//Do stuff with models or, if you're loading more than one model, use this code: :1wait 0if and0248: model #WBDYG2 available 0248: model #WBDYG2 available 0248: model #WBDYG2 available 0248: model #WBDYG2 available jf @1//Do stuff with models The 'wait' opcode at the beginning of an 'if' statement is mandatory to stop your script from crashing. Now to actually spawn your vehicle, you use this code: 00A5: $MyCar = create_car #PONY at 0.0 0.0 0.0 Obviously replacing '#PONY' with the model you loaded. The full code should look like this: The code without checking if the models are available: :00247: load_model #PONY038B: load_requested_models 00A5: $MyCar = create_car #PONY at 0.0 0.0 0.0 end_thread The code with a check to make sure the models are available: :00247: load_model #PONY038B: load_requested_models :1wait 0if0248: model #PONY available jf @100A5: $MyCar = create_car #PONY at 0.0 0.0 0.0 end_thread Link to comment 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