Skip to content

Commit

Permalink
Merge pull request #174 from MrKangM/main
Browse files Browse the repository at this point in the history
add setting ped dimension function
  • Loading branch information
Booster1212 authored Nov 15, 2024
2 parents e1ed42a + 8fbd438 commit fcffaff
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main/server/controllers/ped.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as alt from 'alt-server';
import * as native from 'natives';
import {PedOptions, OmitFirstArg} from '@Shared/types/index.js';
import { PedOptions, OmitFirstArg } from '@Shared/types/index.js';
import { Events } from '../../shared/events/index.js';
import * as Utility from '@Shared/utility/index.js';

Expand Down Expand Up @@ -271,6 +271,19 @@ export function usePed(ped: alt.Ped, uid?: string) {
}, 5000);
}

/**
* set ped dimension
* @param ped
* @param dimension
* @returns
*/
function setPedDimension(ped: alt.Ped, dimension: number) {
if (!ped.valid) {
return;
}
ped.dimension = dimension;
}

peds.set(uid, {
fadeOutAndDestroy,
getClosestPlayer,
Expand All @@ -283,6 +296,7 @@ export function usePed(ped: alt.Ped, uid?: string) {
setFrozen,
setNoCollision,
setOption,
setPedDimension,
});

return {
Expand All @@ -297,6 +311,7 @@ export function usePed(ped: alt.Ped, uid?: string) {
setFrozen,
setNoCollision,
setOption,
setPedDimension,
};
}

Expand Down

0 comments on commit fcffaff

Please sign in to comment.