Skip to content
On this page

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

ts
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

NameTypeDescription
playerPlayerAn alt:V Player Entity
eventInfoAcceptDeclineEvent

Returns

any

Defined in

server/player/emit.ts:724


animation

Usage

Athena.player.emit.animation(player, dictionary, name, flags, duration?): void

Play an animation on this player.

Parameters

NameTypeDefault value
playerPlayerundefined
dictionarystringundefined
namestringundefined
flagsANIMATION_FLAGSundefined
duration?number-1

Returns

void

Defined in

server/player/emit.ts:85


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

NameTypeDescription
playerPlayerAn alt:V Player Entity

Returns

any

Defined in

server/player/emit.ts:111


clearCredits

Usage

Athena.player.emit.clearCredits(player): any

Clears a 'credits' display.

Example

ts
const uidFromAttachment = Athena.player.emit.clearCredits(somePlayer);

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity

Returns

any

Defined in

server/player/emit.ts:522


clearErrorScreen

Usage

Athena.player.emit.clearErrorScreen(player): any

Clear a full-screen message.

Example

ts
Athena.player.emit.clearErrorScreen(somePlayer)

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity

Returns

any

Defined in

server/player/emit.ts:446


clearShard

Usage

Athena.player.emit.clearShard(player): any

Clear a shard.

Example

ts
Athena.player.emit.clearShard(somePlayer);

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity

Returns

any

Defined in

server/player/emit.ts:483


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

ts
Athena.player.emit.clearSpinner(somePlayer);

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity

Returns

any

Defined in

server/player/emit.ts:409


clearTimeCycleEffect

Usage

Athena.player.emit.clearTimeCycleEffect(player): void

Used to clear a screen effect from a player.

Example

ts
Athena.player.emit.clearTimeCycleEffect(somePlayer);

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity

Returns

void

Defined in

server/player/emit.ts:794


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

ts
Athena.player.emit.createCredits(somePlayer, { name: 'Big Text', role: 'Small Text', duration: 2000 });

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
creditsICredit-

Returns

any

Defined in

server/player/emit.ts:504


createErrorScreen

Usage

Athena.player.emit.createErrorScreen(player, screen): any

Create a full-screen message. Cannot be cleared by the player.

Example

ts
Athena.player.emit.createErrorScreen(somePlayer, { title: 'Oh No!', text: 'Something Happened', text2: 'Maybe a suggestion', duration: 5000})

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
screenIErrorScreen

Returns

any

Defined in

server/player/emit.ts:428


createMissionText

Usage

Athena.player.emit.createMissionText(player, text, duration?): any

Create a subtitle on the bottom of the screen with optional duration.

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
textstring
duration?number

Returns

any

Defined in

server/player/emit.ts:215


createProgressBar

Usage

Athena.player.emit.createProgressBar(player, progressbar): string

Create a progress bar that eventually ends itself.

Example

ts
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

NameTypeDescription
playerPlayerAn alt:V Player Entity
progressbarProgressBar

Returns

string

A unique identifier to remove the progress bar.

Defined in

server/player/emit.ts:240


createShard

Usage

Athena.player.emit.createShard(player, shard): any

Create a full-screen shard. Similar to 'mission-passed' or 'wasted'.

Example

ts
Athena.player.emit.createShard(somePlayer, { title: 'Big Text', text: 'Small Text', duration: 5000 })

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
shardIShard-

Returns

any

Defined in

server/player/emit.ts:465


createSpinner

Usage

Athena.player.emit.createSpinner(player, spinner): any

Create a spinner in the bottom-right corner.

Example

ts
Athena.player.emit.createSpinner(somePlayer, { text: 'Doing Something With Spinners', duration: 5000, type: 4 })

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
spinnerISpinner

Returns

any

Defined in

server/player/emit.ts:389


fadeScreenFromBlack

Usage

Athena.player.emit.fadeScreenFromBlack(player, timeInMs): void

Removes the black filter over the screen over time.

Example

ts
Athena.player.emit.fadeScreenFromBlack(somePlayer, 5000);

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
timeInMsnumber

Returns

void

Defined in

server/player/emit.ts:759


fadeScreenToBlack

Usage

Athena.player.emit.fadeScreenToBlack(player, timeInMs): void

Turns the player's screen black over time.

Example

ts
Athena.player.emit.fadeScreenToBlack(somePlayer, 5000);

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
timeInMsnumber

Returns

void

Defined in

server/player/emit.ts:744


message

Usage

Athena.player.emit.message(player, msg): any

Emit a message to a given player.

Example

ts
Athena.player.emit.message(somePlayer, '{FF0000} Hello there! This text is Red :)');

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
msgstring

Returns

any

Defined in

server/player/emit.ts:687


meta

Usage

Athena.player.emit.meta(player, key, value): void

Synchronize a local variable to access locally for this player.

Parameters

NameType
playerPlayer
keystring
valueany

Returns

void

Defined in

server/player/emit.ts:157


notification

Usage

Athena.player.emit.notification(player, message): void

Send a notification to this player.

Example

ts
Athena.player.emit.notification(somePlayer, '~y~Hello There~');

Parameters

NameType
playerPlayer
messagestring

Returns

void

Defined in

server/player/emit.ts:177


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

ts
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

NameTypeDefault valueDescription
playerPlayerundefinedAn alt:V Player Entity
attachableIAttachableundefined
removeAfterMillisecondsnumber-1

Returns

string | null

UID for attachable object

Defined in

server/player/emit.ts:552


objectRemove

Usage

Athena.player.emit.objectRemove(player, uid): any

Remove an attachment object from the player.

Example

ts
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

NameTypeDescription
playerPlayerAn alt:V Player Entity
uidstringA unique string

Returns

any

Defined in

server/player/emit.ts:612


particle

Usage

Athena.player.emit.particle(player, particle, emitToNearbyPlayers?): void

Play a particle effect at a specific coordinate.

Parameters

NameTypeDefault value
playerPlayerundefined
particleParticleundefined
emitToNearbyPlayers?booleanfalse

Returns

void

Defined in

server/player/emit.ts:192


removeProgressBar

Usage

Athena.player.emit.removeProgressBar(player, uid): any

Remove a progress bar based on its unique identifier.

Example

ts
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

NameTypeDescription
playerPlayerAn alt:V Player Entity
uidstringA unique string

Returns

any

Defined in

server/player/emit.ts:271


scenario

Usage

Athena.player.emit.scenario(player, name, duration): void

Play an animation on this player.

Parameters

NameType
playerPlayer
namestring
durationnumber

Returns

void

Defined in

server/player/emit.ts:138


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

ts
Athena.player.emit.setTimeCycleEffect(somePlayer, 'REDMIST', 30000);

Export

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
nameRecommendedTimecycleTypes
amountInMsnumberHow long it should last. -1 for infinite.

Returns

any

Defined in

server/player/emit.ts:763

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

ts
Athena.player.emit.setTimeCycleEffect(somePlayer, 'REDMIST', 30000);

Export

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
namestring
amountInMsnumberHow long it should last. -1 for infinite.

Returns

any

Defined in

server/player/emit.ts:764


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

ts
Athena.player.emit.setWeather(somePlayer, 'Thunder', 30);

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
weatherWEATHER_KEY-
timeInSecondsnumber

Returns

void

Defined in

server/player/emit.ts:811


sound2D

Usage

Athena.player.emit.sound2D(player, audioName, volume?, soundInstantID?): any

Play a custom sound without any positional data.

Example

ts
Athena.player.emit.sound3D(somePlayer, 'error.ogg');

Parameters

NameTypeDefault valueDescription
playerPlayerundefinedAn alt:V Player Entity
audioNamestringundefined
volume?number0.35
soundInstantID?stringundefined-

Returns

any

Defined in

server/player/emit.ts:292


sound3D

Usage

Athena.player.emit.sound3D(player, audioName, target, soundInstantID?): void

Play a sound from at a target's location for this player.

Example

ts
Athena.player.emit.sound3D(somePlayer, 'car_lock.ogg', someVehicle);

Parameters

NameType
playerPlayer
audioNamestring
targetEntity
soundInstantID?string

Returns

void

Defined in

server/player/emit.ts:313


soundFrontend

Usage

Athena.player.emit.soundFrontend(player, audioName, ref): void

Play a frontend sound for this player.

Frontend Audio List

Example

ts
Athena.player.emit.soundFrontend(somePlayer, 'HUD_FRONTEND_DEFAULT_SOUNDSET', 'BACK');

Parameters

NameType
playerPlayer
audioNamestring
refstring

Returns

void

Defined in

server/player/emit.ts:358


soundStop

Usage

Athena.player.emit.soundStop(player, soundInstantID?): void

Stop all custom sounds that may be playing.

This does not stop frontend sounds.

Example

ts
Athena.player.emit.soundStop(somePlayer);

Parameters

NameType
playerPlayer
soundInstantID?string

Returns

void

Defined in

server/player/emit.ts:336


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

NameTypeDescription
playerPlayerAn alt:V Player Entity
namestring

Returns

void

Defined in

server/player/emit.ts:29


stopAlarm

Usage

Athena.player.emit.stopAlarm(player, name): any

Stop an alarm for this player.

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity
namestring

Returns

any

Defined in

server/player/emit.ts:48


stopAllAlarms

Usage

Athena.player.emit.stopAllAlarms(player): any

Stop all alarms for this player.

Parameters

NameTypeDescription
playerPlayerAn alt:V Player Entity

Returns

any

Defined in

server/player/emit.ts:64


taskTimeline

Usage

Athena.player.emit.taskTimeline(player, tasks): any

Force the player to perform an uncancellable task timeline.

Parameters

NameType
playerPlayer
tasksany[]

Returns

any

Defined in

server/player/emit.ts:370


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

NameTypeDescription
playerPlayerAn alt:V Player Entity
modelstring
startIVector3
endIVector3
speednumber

Returns

any

Defined in

server/player/emit.ts:646


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

NameTypeDescription
playerPlayerAn alt:V Player Entity
labelstring
wheelItemsIWheelOption[]

Returns

any

Defined in

server/player/emit.ts:668

Created by Stuyk | Est. 2020