Audio::isMobilePhoneCallOngoing
JavaScript
Return value
- boolean — Returns
trueif a mobile phone call is currently ongoing, otherwise returnsfalse.
Syntax
// Function to check if a mobile phone call is ongoing
function checkMobilePhoneCall() {
// Check if a mobile phone call is ongoing
let isCallOngoing = mp.game.audio.isMobilePhoneCallOngoing();
// Notify the player about the call status
if (isCallOngoing) {
mp.gui.chat.push("You are currently on a phone call.");
} else {
mp.gui.chat.push("You are not on a phone call.");
}
}
// Bind the function to a key (the "E" key)
mp.keys.bind(69, false, function() { // 69 is the key code for "E"
checkMobilePhoneCall(); // Call the function to check the phone call status
});