Skip to content

Commit

Permalink
Merge pull request #31 from puttydotexe/patch-1
Browse files Browse the repository at this point in the history
fix(reloadskin): Fix health being set to full after `/reloadskin`.
  • Loading branch information
Frowmza authored Oct 6, 2024
2 parents a03608f + 5ec925d commit b616416
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/client/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if (core == 'qb' || core == 'qbx' && GetResourceState(frameworkName) == 'started
illeniumCompat();

async function reloadSkin() {
const frameworkID = await getFrameworkID()
const frameworkID = await getFrameworkID();
const health = GetEntityHealth(ped);
const maxhealth = GetEntityMaxHealth(ped);
const armor = GetPedArmour(ped);
Expand All @@ -81,9 +81,13 @@ async function reloadSkin() {
await setPlayerPedAppearance(appearance)

SetPedMaxHealth(ped, maxhealth)
delay(1000)

await delay(1000)

SetEntityHealth(ped, health)
SetPedArmour(ped, armor)
SetPlayerHealthRechargeMultiplier(ped, 0.0);
SetPlayerHealthRechargeLimit(ped, 0.0);
}

onNet('bl_appearance:client:reloadSkin', async () => reloadSkin)
Expand Down

0 comments on commit b616416

Please sign in to comment.