Athena.controllers.object ​
Functions ​
addToPlayer ​
Usage
Athena.controllers.object.addToPlayer(player
, objectData
): string
Add an object to the player that only they can see.
Returns a uid or generates one if not specified.
Example ​
const uid = Athena.controllers.object.addToPlayer(somePlayer, {
model: 'prop_pizza_oven_01',
pos: { x: 0, y: 0, z: 0}
});
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
objectData | IObject |
Returns ​
string
uid A unique string for object
Defined in ​
server/controllers/object.ts:168
append ​
Usage
Athena.controllers.object.append(objectData
): string
Add an object to the global world.
These objects should not be used to construct interiors.
Create an MLO, or use something like CodeWalker to create large scale map changes.
Returns a uid or generates one if not specified.
Example ​
const uid = Athena.controllers.object.append({
model: 'prop_pizza_oven_01',
pos: { x: 0, y: 0, z: 0}
});
Athena.controllers.object.append({
uid: 'the-uid-you-specified',
model: 'prop_pizza_oven_01',
pos: { x: 0, y: 0, z: 0}
});
Parameters ​
Name | Type |
---|---|
objectData | IObject |
Returns ​
string
uid A unique string for object
Defined in ​
server/controllers/object.ts:70
override ​
Usage
Athena.controllers.object.override(functionName
, callback
): any
Used to override any object streamer functionality
Parameters ​
Name | Type |
---|---|
functionName | "append" |
callback | (objectData : IObject ) => string |
Returns ​
any
Defined in ​
server/controllers/object.ts:250
Usage
Athena.controllers.object.override(functionName
, callback
): any
Used to override any object streamer functionality
Parameters ​
Name | Type |
---|---|
functionName | "remove" |
callback | (uid : string ) => boolean |
Returns ​
any
Defined in ​
server/controllers/object.ts:251
Usage
Athena.controllers.object.override(functionName
, callback
): any
Used to override any object streamer functionality
Parameters ​
Name | Type |
---|---|
functionName | "addToPlayer" |
callback | (player : Player , objectData : IObject ) => string |
Returns ​
any
Defined in ​
server/controllers/object.ts:252
Usage
Athena.controllers.object.override(functionName
, callback
): any
Used to override any object streamer functionality
Parameters ​
Name | Type |
---|---|
functionName | "removeFromPlayer" |
callback | (player : Player , uid : string ) => any |
Returns ​
any
Defined in ​
server/controllers/object.ts:253
Usage
Athena.controllers.object.override(functionName
, callback
): any
Used to override any object streamer functionality
Parameters ​
Name | Type |
---|---|
functionName | "updatePosition" |
callback | (uid : string , pos : IVector3 , player? : Player ) => boolean |
Returns ​
any
Defined in ​
server/controllers/object.ts:254
Usage
Athena.controllers.object.override(functionName
, callback
): any
Used to override any object streamer functionality
Parameters ​
Name | Type |
---|---|
functionName | "updateModel" |
callback | (uid : string , model : string , player : Player ) => boolean |
Returns ​
any
Defined in ​
server/controllers/object.ts:255
remove ​
Usage
Athena.controllers.object.remove(uid
): boolean
Removes an object from the global world.
If the object was found and removed this will return true.
Example ​
const result = Athena.controllers.object.remove(someUid);
Athena.controllers.object.remove('the-uid-you-specified');
Parameters ​
Name | Type | Description |
---|---|---|
uid | string | A unique string |
Returns ​
boolean
Defined in ​
server/controllers/object.ts:104
removeFromPlayer ​
Usage
Athena.controllers.object.removeFromPlayer(player
, uid
): any
Remove an object from the player that only they can see.
Example ​
Athena.controllers.object.removeFromPlayer(somePlayer, someUid);
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
uid | string | A unique string |
Returns ​
any
Defined in ​
server/controllers/object.ts:139
updateModel ​
Usage
Athena.controllers.object.updateModel(uid
, model
, player?
): boolean
Parameters ​
Name | Type | Default value |
---|---|---|
uid | string | undefined |
model | string | undefined |
player | Player | undefined |
Returns ​
boolean
Defined in ​
server/controllers/object.ts:224
updatePosition ​
Usage
Athena.controllers.object.updatePosition(uid
, pos
, player?
): boolean
Updates the position for an object.
NOT ALL OBJECTS CAN BE MOVED DYNAMICALLY.
Example ​
Non-Player Object ​
Athena.controllers.object.updatePosition(someUid, { x: 0, y: 0, z: 0});
Player Object ​
Athena.controllers.object.updatePosition(someUid, { x: 0, y: 0, z: 0}, somePlayer);
Parameters ​
Name | Type | Default value | Description |
---|---|---|---|
uid | string | undefined | A unique string |
pos | IVector3 | undefined | A position in the world. |
player? | Player | undefined |
Returns ​
boolean