@overextended/ox_lib
Version:
JS/TS wrapper for ox_lib exports
13 lines (12 loc) • 450 B
JavaScript
import { Ped } from '../../../common/game/Ped';
import { requestModel } from '../../streaming';
/**
* @see {@link CreatePed}
*/
export async function createPed(model, x, y, z, heading = 0, isNetworked = false, bScriptHostPed = false) {
const hash = await requestModel(model);
const handle = CreatePed(0, hash, x, y, z, heading, isNetworked, bScriptHostPed);
SetModelAsNoLongerNeeded(hash);
return new Ped(handle);
}
export { Ped };