03DF

From GTAMods Wiki
Revision as of 08:45, 7 January 2015 by Spaceeinstein (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

GTA III Vice City FORCE_RANDOM_PED_TYPE


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 will revert 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
SET = 0@
GANG_ID = 7  // id for Cubans
GANG_MODELA = #CBA  // model for Cubans
GANG_MODELB = #CBB  // model for Cubans
end

SET = false
while true
    wait 500
    if
        00E1:   player 0 pressed_button 13  // camera key
    then
        if
            SET == false
        then
            SET = true
            018C: play_sound 1 at 0.0 0.0 0.0  // notification sound
            // load appropriate models
            Model.Load(GANG_MODELA)
            Model.Load(GANG_MODELB)
            repeat
                wait 0
                if and
                    Model.Available(GANG_MODELA)
                    Model.Available(GANG_MODELB)
                then
                    break
                end
            until false
            03DF: all_random_peds GANG_ID
        else
            SET = false
            018C: play_sound 1 at 0.0 0.0 0.0  // notification sound
            // models no longer needed
            Model.Destroy(GANG_MODELA)
            Model.Destroy(GANG_MODELB)
            03DF: all_random_peds -1
        end
    end
end