SixL client API / game/event / GameEventMp
Interface: GameEventMp
Shocking events (what the people around a place notice: gunshots, crashes) and decision makers (the rules a ped uses to choose what to do).
Remarks
Every getter returns a Promise. Positions are metres (x east, y north, z up).
Methods
isShockingEventInSphere()
isShockingEventInSphere(type,x,y,z,radius):Promise<boolean>
Tells whether a shocking event of a type happened within a sphere.
Parameters
type
number
The event type, an integer in the game's numbering.
x
number
Centre of the sphere, x in metres.
y
number
Centre of the sphere, y in metres.
z
number
Centre of the sphere, z in metres.
radius
number
Radius of the sphere, metres.
Returns
Promise<boolean>
A Promise of true when such an event is in the sphere.
Example
const near = await mp.game.event.isShockingEventInSphere(1, 0, 0, 72, 10);
removeAllShockingEvents()
removeAllShockingEvents(p0):void
Removes all shocking events.
Parameters
p0
boolean
The game's flag for this call (true or false); its effect is not documented by the game.
Returns
void
Example
mp.game.event.removeAllShockingEvents(true);
removeShockingEvent()
removeShockingEvent(event):Promise<boolean>
Removes a shocking event.
Parameters
event
number
The event's id, an integer.
Returns
Promise<boolean>
A Promise of true when the event was removed.
Example
const removed = await mp.game.event.removeShockingEvent(3);
setDecisionMaker()
setDecisionMaker(ped,name):void
Sets the decision maker a ped uses.
Parameters
ped
The ped.
name
The decision maker's name, or its hash.
Returns
void
Example
mp.game.event.setDecisionMaker(ped.handle, 'decision_maker_name');
suppressShockingEventsNextFrame()
suppressShockingEventsNextFrame(): void
Stops shocking events from being created during the next frame.
Returns
void
Example
mp.game.event.suppressShockingEventsNextFrame();