Athena.player.emit ​
Functions ​
acceptDeclineEvent ​
Usage
Athena.player.emit.acceptDeclineEvent(player
, eventInfo
): any
Prompt the user to accept / decline something.
They must react by holding up arrow to open the menu.
Example ​
function doSomething(player: alt.Player) {
Athena.player.emit.acceptDeclineEvent(somePlayer, {
question: 'Would you like to teleport to the beach?',
onClientEvents: {
accept: 'from-client-event-doSomething',
decline: 'from-client-event-doNothing',
},
});
}
alt.onClient('from-client-event-doSomething', (player: alt.Player) => {
//
});
alt.onClient('from-client-event-doNothing', (player: alt.Player) => {
//
});
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
eventInfo | AcceptDeclineEvent |
Returns ​
any
Defined in ​
animation ​
Usage
Athena.player.emit.animation(player
, dictionary
, name
, flags
, duration?
): void
Play an animation on this player.
Parameters ​
Name | Type | Default value |
---|---|---|
player | Player | undefined |
dictionary | string | undefined |
name | string | undefined |
flags | ANIMATION_FLAGS | undefined |
duration? | number | -1 |
Returns ​
void
Defined in ​
clearAnimation ​
Usage
Athena.player.emit.clearAnimation(player
): any
Used to clear an animation or a task. Does not trigger if the player is in a vehicle.
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
Returns ​
any
Defined in ​
clearCredits ​
Usage
Athena.player.emit.clearCredits(player
): any
Clears a 'credits' display.
Example ​
const uidFromAttachment = Athena.player.emit.clearCredits(somePlayer);
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
Returns ​
any
Defined in ​
clearErrorScreen ​
Usage
Athena.player.emit.clearErrorScreen(player
): any
Clear a full-screen message.
Example ​
Athena.player.emit.clearErrorScreen(somePlayer)
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
Returns ​
any
Defined in ​
clearShard ​
Usage
Athena.player.emit.clearShard(player
): any
Clear a shard.
Example ​
Athena.player.emit.clearShard(somePlayer);
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
Returns ​
any
Defined in ​
clearSpinner ​
Usage
Athena.player.emit.clearSpinner(player
): any
Clear a spinner in the bottom-right corner.
No UID necessary since it can only have one spinner at a time.
Example ​
Athena.player.emit.clearSpinner(somePlayer);
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
Returns ​
any
Defined in ​
clearTimeCycleEffect ​
Usage
Athena.player.emit.clearTimeCycleEffect(player
): void
Used to clear a screen effect from a player.
Example ​
Athena.player.emit.clearTimeCycleEffect(somePlayer);
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
Returns ​
void
Defined in ​
createCredits ​
Usage
Athena.player.emit.createCredits(player
, credits
): any
Create a 'credits' text aligned to a certain side of the screen.
Automatically clear(s) over-time.
Example ​
Athena.player.emit.createCredits(somePlayer, { name: 'Big Text', role: 'Small Text', duration: 2000 });
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
credits | ICredit | - |
Returns ​
any
Defined in ​
createErrorScreen ​
Usage
Athena.player.emit.createErrorScreen(player
, screen
): any
Create a full-screen message. Cannot be cleared by the player.
Example ​
Athena.player.emit.createErrorScreen(somePlayer, { title: 'Oh No!', text: 'Something Happened', text2: 'Maybe a suggestion', duration: 5000})
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
screen | IErrorScreen |
Returns ​
any
Defined in ​
createMissionText ​
Usage
Athena.player.emit.createMissionText(player
, text
, duration?
): any
Create a subtitle on the bottom of the screen with optional duration.
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
text | string | |
duration? | number |
Returns ​
any
Defined in ​
createProgressBar ​
Usage
Athena.player.emit.createProgressBar(player
, progressbar
): string
Create a progress bar that eventually ends itself.
Example ​
const someUid = Athena.player.emit.createProgressBar(somePlayer, {
color: new alt.RGBA(255, 0, 0, 200),
distance: 10,
milliseconds: 30000,
position: new alt.Vector3(somePlayer.pos.x, somePlayer.pos.y, somePlayer.pos.z)
});
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
progressbar | ProgressBar |
Returns ​
string
A unique identifier to remove the progress bar.
Defined in ​
createShard ​
Usage
Athena.player.emit.createShard(player
, shard
): any
Create a full-screen shard. Similar to 'mission-passed' or 'wasted'.
Example ​
Athena.player.emit.createShard(somePlayer, { title: 'Big Text', text: 'Small Text', duration: 5000 })
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
shard | IShard | - |
Returns ​
any
Defined in ​
createSpinner ​
Usage
Athena.player.emit.createSpinner(player
, spinner
): any
Create a spinner in the bottom-right corner.
Example ​
Athena.player.emit.createSpinner(somePlayer, { text: 'Doing Something With Spinners', duration: 5000, type: 4 })
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
spinner | ISpinner |
Returns ​
any
Defined in ​
fadeScreenFromBlack ​
Usage
Athena.player.emit.fadeScreenFromBlack(player
, timeInMs
): void
Removes the black filter over the screen over time.
Example ​
Athena.player.emit.fadeScreenFromBlack(somePlayer, 5000);
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
timeInMs | number |
Returns ​
void
Defined in ​
fadeScreenToBlack ​
Usage
Athena.player.emit.fadeScreenToBlack(player
, timeInMs
): void
Turns the player's screen black over time.
Example ​
Athena.player.emit.fadeScreenToBlack(somePlayer, 5000);
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
timeInMs | number |
Returns ​
void
Defined in ​
message ​
Usage
Athena.player.emit.message(player
, msg
): any
Emit a message to a given player.
Example ​
Athena.player.emit.message(somePlayer, '{FF0000} Hello there! This text is Red :)');
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
msg | string |
Returns ​
any
Defined in ​
meta ​
Usage
Athena.player.emit.meta(player
, key
, value
): void
Synchronize a local variable to access locally for this player.
Parameters ​
Name | Type |
---|---|
player | Player |
key | string |
value | any |
Returns ​
void
Defined in ​
notification ​
Usage
Athena.player.emit.notification(player
, message
): void
Send a notification to this player.
Example ​
Athena.player.emit.notification(somePlayer, '~y~Hello There~');
Parameters ​
Name | Type |
---|---|
player | Player |
message | string |
Returns ​
void
Defined in ​
objectAttach ​
Usage
Athena.player.emit.objectAttach(player
, attachable
, removeAfterMilliseconds?
): string
| null
Attach an object to a player.
Automatically synchronized and handled client-side.
Last parameter is when to remove the object. Automatically set to infinite.
Example ​
const uidFromAttachment = Athena.player.emit.objectAttach(somePlayer, {
model: 'prop_box_ammo01a',
bone: 127,
pos: { x: 0, y: 0, z: 0},
rot: { x: 0, y: 0, z: 0 }
});
Parameters ​
Name | Type | Default value | Description |
---|---|---|---|
player | Player | undefined | An alt:V Player Entity |
attachable | IAttachable | undefined | |
removeAfterMilliseconds | number | -1 |
Returns ​
string
| null
UID for attachable object
Defined in ​
objectRemove ​
Usage
Athena.player.emit.objectRemove(player
, uid
): any
Remove an attachment object from the player.
Example ​
const uidFromAttachment = Athena.player.emit.objectAttach(somePlayer, {
model: 'prop_box_ammo01a',
bone: 127,
pos: { x: 0, y: 0, z: 0},
rot: { x: 0, y: 0, z: 0 }
});
Athena.player.emit.objectRemove(somePlayer, uidFromAttachment);
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
uid | string | A unique string |
Returns ​
any
Defined in ​
particle ​
Usage
Athena.player.emit.particle(player
, particle
, emitToNearbyPlayers?
): void
Play a particle effect at a specific coordinate.
Parameters ​
Name | Type | Default value |
---|---|---|
player | Player | undefined |
particle | Particle | undefined |
emitToNearbyPlayers? | boolean | false |
Returns ​
void
Defined in ​
removeProgressBar ​
Usage
Athena.player.emit.removeProgressBar(player
, uid
): any
Remove a progress bar based on its unique identifier.
Example ​
const someUid = Athena.player.emit.createProgressBar(somePlayer, {
color: new alt.RGBA(255, 0, 0, 200),
distance: 10,
milliseconds: 30000,
position: new alt.Vector3(somePlayer.pos.x, somePlayer.pos.y, somePlayer.pos.z)
});
Athena.player.emit.removeProgressBar(somePlayer, someUid);
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
uid | string | A unique string |
Returns ​
any
Defined in ​
scenario ​
Usage
Athena.player.emit.scenario(player
, name
, duration
): void
Play an animation on this player.
Parameters ​
Name | Type |
---|---|
player | Player |
name | string |
duration | number |
Returns ​
void
Defined in ​
setTimeCycleEffect ​
Usage
Athena.player.emit.setTimeCycleEffect(player
, name
, amountInMs
): any
Used to apply on-screen effects to a given player.
Think of like screen wobbling, drunkness, etc.
Example ​
Athena.player.emit.setTimeCycleEffect(somePlayer, 'REDMIST', 30000);
Export
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
name | RecommendedTimecycleTypes | |
amountInMs | number | How long it should last. -1 for infinite. |
Returns ​
any
Defined in ​
Usage
Athena.player.emit.setTimeCycleEffect(player
, name
, amountInMs
): any
Used to apply on-screen effects to a given player.
Think of like screen wobbling, drunkness, etc.
Example ​
Athena.player.emit.setTimeCycleEffect(somePlayer, 'REDMIST', 30000);
Export
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
name | string | |
amountInMs | number | How long it should last. -1 for infinite. |
Returns ​
any
Defined in ​
setWeather ​
Usage
Athena.player.emit.setWeather(player
, weather
, timeInSeconds
): void
Cleanly transition weather from current weather to a new weather type.
Does not use alt:V functionality. Only uses natives.
Example ​
Athena.player.emit.setWeather(somePlayer, 'Thunder', 30);
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
weather | WEATHER_KEY | - |
timeInSeconds | number |
Returns ​
void
Defined in ​
sound2D ​
Usage
Athena.player.emit.sound2D(player
, audioName
, volume?
, soundInstantID?
): any
Play a custom sound without any positional data.
Example ​
Athena.player.emit.sound3D(somePlayer, 'error.ogg');
Parameters ​
Name | Type | Default value | Description |
---|---|---|---|
player | Player | undefined | An alt:V Player Entity |
audioName | string | undefined | |
volume? | number | 0.35 | |
soundInstantID? | string | undefined | - |
Returns ​
any
Defined in ​
sound3D ​
Usage
Athena.player.emit.sound3D(player
, audioName
, target
, soundInstantID?
): void
Play a sound from at a target's location for this player.
Example ​
Athena.player.emit.sound3D(somePlayer, 'car_lock.ogg', someVehicle);
Parameters ​
Name | Type |
---|---|
player | Player |
audioName | string |
target | Entity |
soundInstantID? | string |
Returns ​
void
Defined in ​
soundFrontend ​
Usage
Athena.player.emit.soundFrontend(player
, audioName
, ref
): void
Play a frontend sound for this player.
Example ​
Athena.player.emit.soundFrontend(somePlayer, 'HUD_FRONTEND_DEFAULT_SOUNDSET', 'BACK');
Parameters ​
Name | Type |
---|---|
player | Player |
audioName | string |
ref | string |
Returns ​
void
Defined in ​
soundStop ​
Usage
Athena.player.emit.soundStop(player
, soundInstantID?
): void
Stop all custom sounds that may be playing.
This does not stop frontend sounds.
Example ​
Athena.player.emit.soundStop(somePlayer);
Parameters ​
Name | Type |
---|---|
player | Player |
soundInstantID? | string |
Returns ​
void
Defined in ​
startAlarm ​
Usage
Athena.player.emit.startAlarm(player
, name
): void
Play an alarm on this player. List of all alarms: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/alarmSounds.json
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
name | string |
Returns ​
void
Defined in ​
stopAlarm ​
Usage
Athena.player.emit.stopAlarm(player
, name
): any
Stop an alarm for this player.
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
name | string |
Returns ​
any
Defined in ​
stopAllAlarms ​
Usage
Athena.player.emit.stopAllAlarms(player
): any
Stop all alarms for this player.
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
Returns ​
any
Defined in ​
taskTimeline ​
Usage
Athena.player.emit.taskTimeline(player
, tasks
): any
Force the player to perform an uncancellable task timeline.
Parameters ​
Name | Type |
---|---|
player | Player |
tasks | any [] |
Returns ​
any
Defined in ​
tempObjectLerp ​
Usage
Athena.player.emit.tempObjectLerp(player
, model
, start
, end
, speed
): any
Allows a temporary object to be created and moved. The object is only seen by this one player.
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
model | string | |
start | IVector3 | |
end | IVector3 | |
speed | number |
Returns ​
any
Defined in ​
wheelMenu ​
Usage
Athena.player.emit.wheelMenu(player
, label
, wheelItems
): any
Create a wheel menu and emit it to the player. Can emit events to client or server-side.
Parameters ​
Name | Type | Description |
---|---|---|
player | Player | An alt:V Player Entity |
label | string | |
wheelItems | IWheelOption [] |
Returns ​
any