- Documentation
- Server functions
- playPedVoiceLine
Function
playPedVoiceLine
Sends every player the onClientPedVoice event with the ped and the line name. The function itself does not play any sound: a client script plays the line, e.g. with playSound3D from a resource sound file attached to the ped. This lets you build custom NPC dialogue heard by everyone nearby.
Syntax
bool playPedVoiceLine(ped ped, string voiceLine)Arguments
pedped- The ped that "speaks".
voiceLinestring- Line name (anything, e.g. a sound file name).
Returns
true once sent.
Example
playPedVoiceLine(shopkeeper, "witaj.mp3")