11
edits
(Created page with "{{ScriptItem |endpoint = shared |type = function |name = gta.createPickup |parameters = int model, [ Vec3 position = Vec3(0.0,0.0,0.0), int pickupType = 0 ] |parameter1 = int...") |
Darkitxu84 (talk | contribs) No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{ScriptItem2 | ||
| | |name = gta.createPickup | ||
|side = shared | |||
|type = function | |type = function | ||
| | |games = iii vc sa iv | ||
| | |desc = add a pickup, use the [[addToWorld|addToWorld]] function afterwards to add the pickup to the players games | ||
| | |arg1 = int model The pickup model ID. | ||
| | |arg2 = [Vec3 position = Vec3(0.0,0.0,0.0)] The position for the pickup. | ||
| | |arg3 = [int pickupType = 2] The pickup type. | ||
| | |return = Pickup The pickup handle. | ||
| | |freturn = null n/a | ||
| | |||
| | |note = Please note that pickup type 0 is invalid. | ||
* List with pickup types can be found [https://gtamods.com/wiki/0213#Pickup_types here] (only for GTA3, GTA:VC and GTA:SA) | |||
* List with pickup models id can be found here: [[Resources/GTA3/Pickups|GTA3]], [[Resources/GTAVC/Pickups|GTA:VC]], [[Resources/GTASA/Pickups|GTA:SA]] | |||
|exampleJS = const MODEL_ID = 431 // Craig Package Model in Vice City | |||
const PICKUP_TYPE = 6 // PICKUP_COLLECTABLE1 in Vice City | |||
addEventHandler("OnResourceStart", function(event, resource) { | |||
gta.createPickup(MODEL_ID, Vec3(0.0,0.0,0.0), PICKUP_TYPE) //Create a pickup in cords X: 0.0, Y: 0.0, Z: 0.0 | |||
}); | |||
}} | }} |
edits