01C3

From GTAMods Wiki
Revision as of 18:17, 13 August 2011 by Spaceeinstein (talk | contribs) (adding example)
Jump to navigation Jump to search

GTA III Vice City San Andreas


Description

Removes references to a vehicle

Syntaxes

Sanny Builder
01C3: [car handle]
Car.RemoveReferences( [car handle] )
Mission Builder
01C3: [car handle]
GTAMA
cleanup_car [car handle]
Point
CleanupCar( [car handle] )
raw binary
C3 01 [data type] [car handle]

Parameter

[car handle]
The handle of a vehicle; vehicle does not have to exist

Native analog

MARK_CAR_AS_NO_LONGER_NEEDED

This opcode will mark the vehicle as no longer needed. The vehicle will no longer be remembered by the game. If you want your vehicle to disappear after it is destroyed or after you are finished with it, use this opcode to make it into a random traffic vehicle so it will disappear like a traffic vehicle. This opcode is only needed when the vehicle is spawned (00A5, etc.) or grabbed from the streets (0327, etc.). This opcode is not needed for any other cases. Using this with disregard will cause problems with other scripts trying to recognize the same vehicle.


Liberty City Stories


Equivalent opcode: 01C8
For the usage of 01C3 in the script, see 01BE.

Vice City Stories


Equivalent opcode: 0113

Example

The following example, using Sanny Builder, will spawn a Pony in front of the player character. A number is displayed on the screen to show the existence of the Pony, 0 means it does not exist while 1 means it does. Pressing the ACTION key will mark the Pony as no longer needed. If left alone, the Pony will disappear like normal traffic vehicles.

// spawn pony
Model.Load(#PONY)
repeat
    wait 0
    if
        #PONY.Available()
    then
        break
    end
until false
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset 0.0 3.0 0.0
Car.Create(0@, #PONY, 1@, 2@, 3@)
Model.Destroy(#PONY)
1@ = 1  // pony exists

// check the existence of and remove references to pony
while true
    wait 10
    if 
        00E1:   key_pressed 0 4  // action key
    then
        Car.RemoveReferences(0@)
    end
    if
        Car.Wrecked(0@)
    then
        1@ = 0  // pony does not exist
    end
    // display existence of pony as a number onscreen
    01E5: text_1number_highpriority 'NUMBER' 1@ 10 ms 1
end

Keywords

remove, cleanup, reference, references, car, vehicle