Difference between revisions of "0129"

From GTAMods Wiki
Jump to navigation Jump to search
(New page: {{OpCode | ini = 0129=4,%4d% %2d% %3o% %1d% | description = Creates a character in the driver seat of a vehicle | p1 = Existing vehicle handle | p2 = Ped type...)
 
m
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{OpCode
 
{{OpCode
| ini        = 0129=4,%4d% %2d% %3o% %1d%
+
| games      = {{icon|t}}
| description = Creates a character in the driver seat of a vehicle
+
| command    = CREATE_CHAR_INSIDE_CAR
| p1          = Existing vehicle handle
+
| description = Spawns a character in the driver seat of the vehicle
| p2          = [[Ped type]]
+
| syntax1    = 0129: [''var''] = create_actor_pedtype [''int1''] model [''int2''] in_car [''car handle''] driverseat
| p3          = Valid ped [[DFF]] model name or ID number as defined in the [[IDE#PEDS|IDE]] file
+
| p1t        = [''car handle'']
| p4          = Actor handle
+
| p1d        = The handle of the vehicle
| game        = GTA3, Vice City, San Andreas
+
| p2t        = [''int1'']
 +
| p2d        = [[Ped type]]
 +
| p3t        = [''int2'']
 +
| p3d        = Valid model index as defined in the [[PEDS|PEDS section]] of the [[IDE]] file; also acceptable is model's [[DFF]] name with a hash character
 +
| p4t        = [''var'']
 +
| p4d        = Variable to store the handle of the character
 
| native      = [[CREATE_CHAR_INSIDE_CAR]]
 
| native      = [[CREATE_CHAR_INSIDE_CAR]]
 
}}
 
}}
This creates a character in the driver seat of a vehicle. Using this opcode requires an existing vehicle and [[0247]] to load the character model or else the game could crash. Note that the parameters are mixed around.
 
[[Sanny Builder]] example:<source lang="scm">0129: 1@ = create_actor_pedtype 5 model #BFORI in_car 0@ driverseat</source>
 
  
==Note==
+
This opcode spawns a character in the driver seat of a vehicle. Using this opcode requires an existing vehicle and opcode [[0247]] to load the character model or else the game could crash.
The above format is more commonly used. The actual format of this opcode is in order:<br>
 
<code>0129=4,%1d% %2d% %3o% %4d%</code><br>
 
The format to use depends on which INI file you use.
 
  
==Keywords==
+
== Example ==
create, actor, character, pedtype, model, vehicle, car, driver
+
:''See also: [[Spawn a ped]]''
 +
The following example, using Sanny Builder, will spawn a ped in a car close to the player character.
 +
{{Pre|class=sb-code|1=
 +
<span class="k">const</span>
 +
CHAR_MODEL = <span class="nt">#BFORI</span>  <span class="c1">// set your character model</span>
 +
CAR_MODEL = <span class="nt">#PONY</span>  <span class="c1">// set your vehicle model</span>
 +
CHAR_HANDLE = <span class="nv">0@</span>
 +
CAR_HANDLE = <span class="nv">1@</span>
 +
X_POS = <span class="nv">2@</span>
 +
Y_POS = <span class="nv">3@</span>
 +
Z_POS = <span class="nv">4@</span>
 +
<span class="k">end</span>
 +
 
 +
[[0247]]: request_model CHAR_MODEL
 +
[[0247]]: request_model CAR_MODEL
 +
[[038B]]: load_requested_models
 +
[[00A0]]: store_actor <span class="nv">$PLAYER_ACTOR</span> position_to X_POS Y_POS Z_POS
 +
X_POS += <span class="m">4.0</span>
 +
[[00A5]]: CAR_HANDLE = create_car CAR_MODEL at X_POS Y_POS Z_POS
 +
0129: CHAR_HANDLE = create_actor_pedtype <span class="m">4</span> model CHAR_MODEL in_car CAR_HANDLE driverseat
 +
[[0249]]: release_model CHAR_MODEL
 +
[[0249]]: release_model CAR_MODEL
 +
[[01C2]]: mark_actor_as_no_longer_needed CHAR_HANDLE
 +
[[01C3]]: mark_car_as_no_longer_needed CAR_HANDLE
 +
}}
 +
 
 +
== Keywords ==
 +
create, spawn, actor, ped, pedestrian, character, pedtype, model, inside, vehicle, car, driver

Latest revision as of 05:03, 15 April 2017

GTA III Vice City San Andreas CREATE_CHAR_INSIDE_CAR


Description
Spawns a character in the driver seat of the vehicle
Syntax
0129: [var] = create_actor_pedtype [int1] model [int2] in_car [car handle] driverseat
Parameter
[car handle]
The handle of the vehicle
[int1]
Ped type
[int2]
Valid model index as defined in the PEDS section of the IDE file; also acceptable is model's DFF name with a hash character
[var]
Variable to store the handle of the character
Native analog
CREATE_CHAR_INSIDE_CAR

This opcode spawns a character in the driver seat of a vehicle. Using this opcode requires an existing vehicle and opcode 0247 to load the character model or else the game could crash.

Example

See also: Spawn a ped

The following example, using Sanny Builder, will spawn a ped in a car close to the player character.

const
CHAR_MODEL = #BFORI  // set your character model
CAR_MODEL = #PONY  // set your vehicle model
CHAR_HANDLE = 0@
CAR_HANDLE = 1@
X_POS = 2@
Y_POS = 3@
Z_POS = 4@
end

0247: request_model CHAR_MODEL
0247: request_model CAR_MODEL
038B: load_requested_models
00A0: store_actor $PLAYER_ACTOR position_to X_POS Y_POS Z_POS
X_POS += 4.0
00A5: CAR_HANDLE = create_car CAR_MODEL at X_POS Y_POS Z_POS
0129: CHAR_HANDLE = create_actor_pedtype 4 model CHAR_MODEL in_car CAR_HANDLE driverseat
0249: release_model CHAR_MODEL
0249: release_model CAR_MODEL
01C2: mark_actor_as_no_longer_needed CHAR_HANDLE
01C3: mark_car_as_no_longer_needed CAR_HANDLE

Keywords

create, spawn, actor, ped, pedestrian, character, pedtype, model, inside, vehicle, car, driver