From b769bf0cde8966a300a173bbed8cf9ba115bc28c Mon Sep 17 00:00:00 2001 From: RockySouthpaw <55056068+RockySouthpaw@users.noreply.github.com> Date: Fri, 16 Oct 2020 21:23:52 -0400 Subject: [PATCH 1/3] Added some debug code --- resources/client/cl_main.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/client/cl_main.ts b/resources/client/cl_main.ts index 517ecc8..e4a35a5 100644 --- a/resources/client/cl_main.ts +++ b/resources/client/cl_main.ts @@ -62,6 +62,7 @@ async function loadAnimDict(dict: any) { //-- Loads the animation dict. Used in } async function phoneOpenAnim() { //Phone Open Animation + console.log("phoneOpenAnim") //Left for testing purposes. const flag = 50 //https://runtime.fivem.net/doc/natives/?_0xEA47FE3719165B94 deletePhone() //Deleting before creating a new phone where itll be deleted again. if (IsPedInAnyVehicle(GetPlayerPed(-1), true)) { //-- true refers to at get in. @@ -87,12 +88,13 @@ async function phoneOpenAnim() { //Phone Open Animation } async function phoneCloseAnim() { //Phone Close Animation + console.log("phoneCloseAnim") //Left for testing purposes. const flag = 50 //https://runtime.fivem.net/doc/natives/?_0xEA47FE3719165B94 const anim = 'cellphone_text_out' if (IsPedInAnyVehicle(GetPlayerPed(-1), true)) { //true refers to at get in. const dict = 'anim@cellphone@in_car@ps' const kek = "pepein" - + StopAnimTask(GetPlayerPed(-1), dict, 'cellphone_text_in', 1.0) //Stop the pull out animation deletePhone() //Deletes the prop early incase they get out of the vehicle. await Delay(250) //lets it get to a certain point @@ -146,12 +148,12 @@ setTick(() => { async function Phone() { if (config.PhoneAsItem) { + console.log("CONFIG ON") carryingPhone(async (carryingPhone: any) => { if (carryingPhone) { if (!isPhoneOpen) { isPhoneOpen = true await phoneOpenAnim() - console.log("phone is now open") //Left for testing purposes. emitNet(events.CONTACTS_GET_CONTACTS); emitNet('phone:getCredentials') // Gets the credentials. Will eventually most likely only get the phone number and name, idk. SetCursorLocation(0.936, 0.922) //Experimental @@ -168,7 +170,7 @@ async function Phone() { } else { isPhoneOpen = false - console.log("phone is now closed") //Left for testing purposes. + await phoneCloseAnim() SendNuiMessage( //Hides phone JSON.stringify({ app: "PHONE", @@ -177,7 +179,6 @@ async function Phone() { }) ) SetNuiFocus(false, false) - phoneCloseAnim() } } else { @@ -186,10 +187,10 @@ async function Phone() { }) } else if (!config.PhoneAsItem) { + console.log("CONFIG OFF") if (!isPhoneOpen) { isPhoneOpen = true await phoneOpenAnim() - console.log("phone is now open") //Left for testing purposes. emitNet(events.CONTACTS_GET_CONTACTS); emitNet('phone:getCredentials') SetCursorLocation(0.936, 0.922) //Experimental @@ -206,7 +207,7 @@ async function Phone() { } else { isPhoneOpen = false - console.log("phone is now closed") //Left for testing purposes. + await phoneCloseAnim() SendNuiMessage( //Hides phone JSON.stringify({ app: "PHONE", @@ -215,7 +216,6 @@ async function Phone() { }) ) SetNuiFocus(false, false) - await phoneCloseAnim() } } } From 1f7a4577628dd210bccfc66bcd269d66aa4b75db Mon Sep 17 00:00:00 2001 From: RockySouthpaw <55056068+RockySouthpaw@users.noreply.github.com> Date: Sat, 17 Oct 2020 00:03:40 -0400 Subject: [PATCH 2/3] Removed const kek --- resources/client/cl_main.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/resources/client/cl_main.ts b/resources/client/cl_main.ts index e4a35a5..295c577 100644 --- a/resources/client/cl_main.ts +++ b/resources/client/cl_main.ts @@ -67,7 +67,6 @@ async function phoneOpenAnim() { //Phone Open Animation deletePhone() //Deleting before creating a new phone where itll be deleted again. if (IsPedInAnyVehicle(GetPlayerPed(-1), true)) { //-- true refers to at get in. const dict = 'anim@cellphone@in_car@ps' - const kek = "pepein" ClearPedTasks(GetPlayerPed(-1)) await loadAnimDict(dict) @@ -77,7 +76,6 @@ async function phoneOpenAnim() { //Phone Open Animation } else { //While not in a vehicle it will use this dict. const dict = 'cellphone@' - const kek = "pepeout" ClearPedTasks(GetPlayerPed(-1)) await loadAnimDict(dict) @@ -93,7 +91,6 @@ async function phoneCloseAnim() { //Phone Close Animation const anim = 'cellphone_text_out' if (IsPedInAnyVehicle(GetPlayerPed(-1), true)) { //true refers to at get in. const dict = 'anim@cellphone@in_car@ps' - const kek = "pepein" StopAnimTask(GetPlayerPed(-1), dict, 'cellphone_text_in', 1.0) //Stop the pull out animation deletePhone() //Deletes the prop early incase they get out of the vehicle. @@ -105,7 +102,6 @@ async function phoneCloseAnim() { //Phone Close Animation } else { //While not in a vehicle it will use this dict. const dict = 'cellphone@' - const kek = "pepeout" StopAnimTask(GetPlayerPed(-1), dict, 'cellphone_text_in', 1.0) //Stop the pull out animation await Delay(100) //lets it get to a certain point From ab7390f56c746fcace4949ce1349befb2a1e1707 Mon Sep 17 00:00:00 2001 From: RockySouthpaw <55056068+RockySouthpaw@users.noreply.github.com> Date: Sat, 17 Oct 2020 00:22:05 -0400 Subject: [PATCH 3/3] Fixed animations. --- resources/client/cl_main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/client/cl_main.ts b/resources/client/cl_main.ts index 295c577..5f4d7f2 100644 --- a/resources/client/cl_main.ts +++ b/resources/client/cl_main.ts @@ -96,7 +96,7 @@ async function phoneCloseAnim() { //Phone Close Animation deletePhone() //Deletes the prop early incase they get out of the vehicle. await Delay(250) //lets it get to a certain point loadAnimDict(dict) //loads the new animation - TaskPlayAnim(GetPlayerPed(-1), dict, anim, 8.0, -1, -1, flag, 1, false, false, false) //puts phone into pocket + TaskPlayAnim(GetPlayerPed(-1), dict, anim, 8.0, -1, -1, flag, 0, false, false, false) //puts phone into pocket await Delay(200) //waits until the phone is in the pocket StopAnimTask(GetPlayerPed(-1), dict, anim, 1.0) //clears the animation } @@ -106,7 +106,7 @@ async function phoneCloseAnim() { //Phone Close Animation StopAnimTask(GetPlayerPed(-1), dict, 'cellphone_text_in', 1.0) //Stop the pull out animation await Delay(100) //lets it get to a certain point loadAnimDict(dict) //loads the new animation - TaskPlayAnim(GetPlayerPed(-1), dict, anim, 8.0, -1, -1, flag, 1, false, false, false) //puts phone into pocket + TaskPlayAnim(GetPlayerPed(-1), dict, anim, 8.0, -1, -1, flag, 0, false, false, false) //puts phone into pocket await Delay(200) //waits until the phone is in the pocket StopAnimTask(GetPlayerPed(-1), dict, anim, 1.0) //clears the animation deletePhone() //Deletes the prop.