Difference between revisions of "01B2"
Jump to navigation
Jump to search
m |
|||
Line 1: | Line 1: | ||
− | + | {{OpCode | |
− | + | | ini = 01B2=3,%1d% %2d% %3d% | |
− | + | | description = Gives a weapon to a character | |
− | + | | p1 = Existing actor handle | |
− | + | | p2 = [[Weapon]] number | |
− | + | | p3 = Ammo | |
− | + | | game = GTA3, Vice City, San Andreas | |
− | This gives a weapon to | + | | native = [[GIVE_WEAPON_TO_CHAR]] |
+ | }} | ||
+ | This gives a weapon to a character. Using this opcode requires [[0247]] or else the weapon would not be visible and might possibly crash the game. | ||
==Example== | ==Example== | ||
− | This will be only shown as an example on how to assign a weapon to | + | This will be only shown as an example on how to assign a weapon to a character and shouldn't be copied verbatim. There are other ways of doing this. The following code uses the Sanny Builder. |
− | + | <source lang="scm"> | |
− | < | + | :LoadModel |
− | + | 0247: load_model #BFORI | |
− | + | 0247: load_model #COLT45 | |
− | + | ||
− | + | :CheckModel | |
− | + | 0001: wait 0 ms | |
− | + | 00D6: if and | |
− | + | 0248: model #BFORI available | |
− | + | 0248: model #COLT45 available | |
− | + | 004D: jump_if_false @CheckModel | |
− | + | 009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0 | |
− | + | 01B2: give_actor 0@ weapon 22 ammo 100 | |
− | + | 0249: release_model #BFORI | |
− | + | 0249: release_model #COLT45 | |
− | + | 004E: end_thread | |
+ | </source> | ||
==Keywords== | ==Keywords== | ||
− | give, assign, actor, weapon | + | give, assign, actor, character, weapon |
[[Category:OpCodes]] | [[Category:OpCodes]] |
Revision as of 23:54, 27 December 2008
{{{games}}}
- Description
- Gives a weapon to a character
- Syntax
- {{{syntax1}}}
- Parameter
- Native analog
- GIVE_WEAPON_TO_CHAR
This gives a weapon to a character. Using this opcode requires 0247 or else the weapon would not be visible and might possibly crash the game.
Example
This will be only shown as an example on how to assign a weapon to a character and shouldn't be copied verbatim. There are other ways of doing this. The following code uses the Sanny Builder.
:LoadModel
0247: load_model #BFORI
0247: load_model #COLT45
:CheckModel
0001: wait 0 ms
00D6: if and
0248: model #BFORI available
0248: model #COLT45 available
004D: jump_if_false @CheckModel
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
01B2: give_actor 0@ weapon 22 ammo 100
0249: release_model #BFORI
0249: release_model #COLT45
004E: end_thread
Keywords
give, assign, actor, character, weapon