Difference between revisions of "03DF"
(Created page with "{{Icon|3}} {{Icon|VC}} '''FORCE_RANDOM_PED_TYPE''' <hr /> '''Description''' : Forces the ped type of on foot pedestrians '''Syntax''' : 03DF: all_random_peds [''int''] '''Para...") |
m |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{Icon|3}} {{Icon|VC}} | + | {{OpCode |
− | + | | games = {{Icon|3}} {{Icon|VC}} | |
− | + | | command = FORCE_RANDOM_PED_TYPE | |
− | + | | description = Forces the ped type of on foot pedestrians | |
− | + | | syntax1 = 03DF: all_random_peds [''int''] | |
− | + | | p1t = [''int''] | |
− | + | | p1d = [[Ped type]] or ''-1'' | |
− | + | }} | |
− | |||
− | This opcode forces the game to only spawn on foot pedestrians of the specified ped type. The only ped types that work with this opcode are any valid gangs, emergency, and fireman. All other values either have no effect or crash the game. When used with gangs, you must [[0247|load]] the models of the appropriate [[gang]] or else the map will be devoid of on foot pedestrians. Emergency and fireman models do not need to be explicitly loaded. This opcode has no effect on drivers in cars. A value of -1 | + | This opcode forces the game to only spawn on foot pedestrians of the specified ped type. The only ped types that work with this opcode are any valid gangs, emergency, and fireman. All other values either have no effect or crash the game. When used with gangs, you must [[0247|load]] the models of the appropriate [[gang]] or else the map will be devoid of on foot pedestrians. Emergency and fireman models do not need to be explicitly loaded. This opcode has no effect on drivers in cars. A value of ''-1'' reverts the effects of this opcode. The original scripts called this opcode during rampages. |
== Example == | == Example == | ||
The following example, for Vice City using Sanny Builder, will allow you to force the spawning of Cuban gang members after pressing the CAMERA key. The effect can be undone using the same key. | The following example, for Vice City using Sanny Builder, will allow you to force the spawning of Cuban gang members after pressing the CAMERA key. The effect can be undone using the same key. | ||
− | < | + | {{Pre|class=sb-code|1= |
− | // set constants | + | <span class="c1">// set constants</span> |
− | const | + | <span class="k">const</span> |
− | + | FORCE_RANDOM_SET = <span class="nv">0@</span> | |
− | GANG_ID = 7 // id for Cubans | + | GANG_ID = <span class="m">7</span> <span class="c1">// id for Cubans</span> |
− | GANG_MODELA = #CBA // model for Cubans | + | GANG_MODELA = <span class="nt">#CBA</span> <span class="c1">// model for Cubans</span> |
− | GANG_MODELB = #CBB // model for Cubans | + | GANG_MODELB = <span class="nt">#CBB</span> <span class="c1">// model for Cubans</span> |
− | end | + | <span class="k">end</span> |
− | + | FORCE_RANDOM_SET = <span class="k">false</span> | |
− | while true | + | <span class="k">while</span> <span class="k">true</span> |
− | wait | + | <span class="k">wait</span> <span class="m">10</span> |
− | if | + | <span class="k">if</span> |
− | 00E1: player 0 pressed_button 13 // camera key | + | [[00E1]]: player <span class="m">0</span> pressed_button <span class="m">13</span> <span class="c1">// camera key</span> |
− | then | + | <span class="k">then</span> |
− | + | <span class="k">while</span> [[00E1]]: player <span class="m">0</span> pressed_button <span class="m">13</span> <span class="c1">// camera key</span> | |
− | + | <span class="k">wait</span> <span class="m">0</span> | |
− | + | <span class="k">end</span> | |
− | + | [[018C]]: play_sound <span class="m">1</span> at <span class="m">0.0</span> <span class="m">0.0</span> <span class="m">0.0</span> <span class="c1">// notification sound</span> | |
− | + | <span class="k">if</span> | |
− | // load appropriate models | + | FORCE_RANDOM_SET == <span class="k">false</span> |
− | + | <span class="k">then</span> | |
− | + | FORCE_RANDOM_SET = <span class="k">true</span> | |
− | + | <span class="c1">// load appropriate models</span> | |
− | + | [[0247]]: request_model GANG_MODELA | |
− | + | [[0247]]: request_model GANG_MODELB | |
− | + | [[038B]]: load_requested_models | |
− | |||
− | |||
− | |||
− | |||
− | |||
03DF: all_random_peds GANG_ID | 03DF: all_random_peds GANG_ID | ||
− | else | + | <span class="k">else</span> |
− | + | FORCE_RANDOM_SET = <span class="k">false</span> | |
− | + | <span class="c1">// models no longer needed</span> | |
− | // models no longer needed | + | [[0249]]: release_model GANG_MODELA |
− | + | [[0249]]: release_model GANG_MODELB | |
− | + | 03DF: all_random_peds -<span class="m">1</span> | |
− | 03DF: all_random_peds -1 | + | <span class="k">end</span> |
− | end | + | <span class="k">end</span> |
− | end | + | <span class="k">end</span> |
− | end | + | }} |
− | </ | + | |
+ | == Keywords == | ||
+ | all, force, random, ped, type, peds | ||
− | |||
[[Category:Code Snippets]] | [[Category:Code Snippets]] |
Latest revision as of 05:27, 20 December 2016
- Description
- Forces the ped type of on foot pedestrians
- Syntax
- 03DF: all_random_peds [int]
- Parameter
- [int]
- Ped type or -1
This opcode forces the game to only spawn on foot pedestrians of the specified ped type. The only ped types that work with this opcode are any valid gangs, emergency, and fireman. All other values either have no effect or crash the game. When used with gangs, you must load the models of the appropriate gang or else the map will be devoid of on foot pedestrians. Emergency and fireman models do not need to be explicitly loaded. This opcode has no effect on drivers in cars. A value of -1 reverts the effects of this opcode. The original scripts called this opcode during rampages.
Example
The following example, for Vice City using Sanny Builder, will allow you to force the spawning of Cuban gang members after pressing the CAMERA key. The effect can be undone using the same key.
// set constants const FORCE_RANDOM_SET = 0@ GANG_ID = 7 // id for Cubans GANG_MODELA = #CBA // model for Cubans GANG_MODELB = #CBB // model for Cubans end FORCE_RANDOM_SET = false while true wait 10 if 00E1: player 0 pressed_button 13 // camera key then while 00E1: player 0 pressed_button 13 // camera key wait 0 end 018C: play_sound 1 at 0.0 0.0 0.0 // notification sound if FORCE_RANDOM_SET == false then FORCE_RANDOM_SET = true // load appropriate models 0247: request_model GANG_MODELA 0247: request_model GANG_MODELB 038B: load_requested_models 03DF: all_random_peds GANG_ID else FORCE_RANDOM_SET = false // models no longer needed 0249: release_model GANG_MODELA 0249: release_model GANG_MODELB 03DF: all_random_peds -1 end end end
Keywords
all, force, random, ped, type, peds