mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Merge branch 'master' of https://github.com/project-error/new-phone-who-dis
This commit is contained in:
commit
9f5d5e50a8
2 files changed
+37
-22
No files matched your search
@@ -2,10 +2,7 @@ import config from '../utils/config';
|
|||||||
import events from '../utils/events';
|
import events from '../utils/events';
|
||||||
import { phoneCloseAnim, phoneOpenAnim, removePhoneProp } from './functions';
|
import { phoneCloseAnim, phoneOpenAnim, removePhoneProp } from './functions';
|
||||||
|
|
||||||
let prop = 0;
|
|
||||||
let isPhoneOpen = false;
|
let isPhoneOpen = false;
|
||||||
let propCreated = false;
|
|
||||||
let phoneModel = 'prop_amb_phone'; // Refered to in newphoneProp function. Requires custom phone being streamed.
|
|
||||||
|
|
||||||
RegisterKeyMapping('phone', 'Open Phone', 'keyboard', 'f1');
|
RegisterKeyMapping('phone', 'Open Phone', 'keyboard', 'f1');
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import { Delay } from '../utils/fivem';
|
import { Delay } from '../utils/fivem';
|
||||||
|
|
||||||
let prop = 0;
|
let prop = 0;
|
||||||
let isPhoneOpen = false;
|
|
||||||
let propCreated = false;
|
let propCreated = false;
|
||||||
const phoneModel = 'prop_amb_phone'
|
const phoneModel = 'prop_amb_phone';
|
||||||
|
|
||||||
/* * * * * * * * * * * * *
|
/* * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
@@ -79,11 +78,11 @@ export async function loadAnimDict(dict: any) {
|
|||||||
await Delay(100);
|
await Delay(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleOpenVehicleAnim = async (playerPed: number): Promise<void> => {
|
const handleOpenVehicleAnim = async (playerPed: number): Promise<void> => {
|
||||||
const dict = 'anim@cellphone@in_car@ps';
|
const dict = 'anim@cellphone@in_car@ps';
|
||||||
|
|
||||||
SetCurrentPedWeapon(playerPed, 0xA2719263, true)
|
SetCurrentPedWeapon(playerPed, 0xa2719263, true);
|
||||||
ClearPedTasks(playerPed);
|
ClearPedTasks(playerPed);
|
||||||
await loadAnimDict(dict);
|
await loadAnimDict(dict);
|
||||||
TaskPlayAnim(
|
TaskPlayAnim(
|
||||||
@@ -99,15 +98,15 @@ const handleOpenVehicleAnim = async (playerPed: number): Promise<void> => {
|
|||||||
false,
|
false,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
await Delay(300);
|
await Delay(300);
|
||||||
await newPhoneProp();
|
await newPhoneProp();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOpenNormalAnim = async (playerPed: number): Promise<void> => {
|
const handleOpenNormalAnim = async (playerPed: number): Promise<void> => {
|
||||||
//While not in a vehicle it will use this dict.
|
//While not in a vehicle it will use this dict.
|
||||||
const dict = 'cellphone@';
|
const dict = 'cellphone@';
|
||||||
|
|
||||||
SetCurrentPedWeapon(playerPed, 0xA2719263, true)
|
SetCurrentPedWeapon(playerPed, 0xa2719263, true);
|
||||||
ClearPedTasks(playerPed);
|
ClearPedTasks(playerPed);
|
||||||
await loadAnimDict(dict);
|
await loadAnimDict(dict);
|
||||||
TaskPlayAnim(
|
TaskPlayAnim(
|
||||||
@@ -123,8 +122,8 @@ const handleOpenNormalAnim = async (playerPed: number): Promise<void> => {
|
|||||||
false,
|
false,
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
await Delay(300);
|
await Delay(300);
|
||||||
await newPhoneProp();
|
await newPhoneProp();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCloseVehicleAnim = async (playerPed: number): Promise<void> => {
|
const handleCloseVehicleAnim = async (playerPed: number): Promise<void> => {
|
||||||
@@ -139,12 +138,12 @@ const handleCloseNormalAnim = async (playerPed: number): Promise<void> => {
|
|||||||
const DICT = 'cellphone@';
|
const DICT = 'cellphone@';
|
||||||
const ANIM = 'cellphone_text_out';
|
const ANIM = 'cellphone_text_out';
|
||||||
StopAnimTask(playerPed, DICT, 'cellphone_text_in', 1.0);
|
StopAnimTask(playerPed, DICT, 'cellphone_text_in', 1.0);
|
||||||
await Delay(100);
|
await Delay(100);
|
||||||
await loadAnimDict(DICT);
|
await loadAnimDict(DICT);
|
||||||
TaskPlayAnim(playerPed, DICT, ANIM, 7.0, -1, -1, 50, 0, false, false, false);
|
TaskPlayAnim(playerPed, DICT, ANIM, 7.0, -1, -1, 50, 0, false, false, false);
|
||||||
await Delay(200);
|
await Delay(200);
|
||||||
StopAnimTask(playerPed, DICT, ANIM, 1.0);
|
StopAnimTask(playerPed, DICT, ANIM, 1.0);
|
||||||
removePhoneProp();
|
removePhoneProp();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCallStartVehicleAnim = async (playerPed: number): Promise<void> => {
|
const handleCallStartVehicleAnim = async (playerPed: number): Promise<void> => {
|
||||||
@@ -167,17 +166,36 @@ const handleCallEndVehicleAnim = async (playerPed: number): Promise<void> => {
|
|||||||
const handleCallStartNormalAnim = async (playerPed: number): Promise<void> => {
|
const handleCallStartNormalAnim = async (playerPed: number): Promise<void> => {
|
||||||
const DICT = 'cellphone@';
|
const DICT = 'cellphone@';
|
||||||
const ANIM = 'cellphone_call_listen_base';
|
const ANIM = 'cellphone_call_listen_base';
|
||||||
await loadAnimDict(DICT);
|
await loadAnimDict(DICT);
|
||||||
TaskPlayAnim(playerPed, DICT, ANIM, 3.0, 3.0, -1, 49, 0, false, false, false);
|
TaskPlayAnim(playerPed, DICT, ANIM, 3.0, 3.0, -1, 49, 0, false, false, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCallEndNormalAnim = async (playerPed: number): Promise<void> => {
|
const handleCallEndNormalAnim = async (playerPed: number): Promise<void> => {
|
||||||
const DICT = 'cellphone@';
|
const DICT = 'cellphone@';
|
||||||
const ANIM = 'cellphone_call_to_text';
|
const ANIM = 'cellphone_call_to_text';
|
||||||
|
|
||||||
if (IsEntityPlayingAnim(playerPed, 'cellphone@', 'cellphone_call_listen_base', 49)) {
|
if (
|
||||||
await loadAnimDict(DICT);
|
IsEntityPlayingAnim(
|
||||||
TaskPlayAnim(playerPed, DICT, ANIM, 2.5, 8.0, -1, 50, 0, false, false, false);
|
playerPed,
|
||||||
|
'cellphone@',
|
||||||
|
'cellphone_call_listen_base',
|
||||||
|
49
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
await loadAnimDict(DICT);
|
||||||
|
TaskPlayAnim(
|
||||||
|
playerPed,
|
||||||
|
DICT,
|
||||||
|
ANIM,
|
||||||
|
2.5,
|
||||||
|
8.0,
|
||||||
|
-1,
|
||||||
|
50,
|
||||||
|
0,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user