@@ -9,7 +9,7 @@ export function usePlayerGetter() {
99 *
1010 * #### Example
1111 * ```ts
12- * const player = Athena.getters.player .byAccount('123456789');
12+ * const player = Rebar.get.usePlayerGetter() .byAccount('123456789');
1313 * if (player) {
1414 * console.log(`Found player ${player.id} with account ID ${player.account._id}`);
1515 * } else {
@@ -171,8 +171,8 @@ export function usePlayerGetter() {
171171 * @return {(alt.Player | undefined) }
172172 */
173173 function closestToPlayer ( player : alt . Player , range = 10 ) : alt . Player | undefined {
174- const results = alt . getClosestEntities ( player . pos , range , player . dimension , - 1 , 1 ) as alt . Player [ ] ;
175- return results . length >= 1 ? results [ 0 ] : undefined ;
174+ const results = alt . Utils . getClosestPlayer ( { pos : player . pos , range } ) as alt . Player ;
175+ return results ? results : undefined ;
176176 }
177177
178178 /**
@@ -182,8 +182,8 @@ export function usePlayerGetter() {
182182 * @return {(alt.Player | undefined) }
183183 */
184184 function closestToVehicle ( vehicle : alt . Vehicle , range = 25 ) : alt . Player | undefined {
185- const results = alt . getClosestEntities ( vehicle . pos , range , vehicle . dimension , - 1 , 1 ) as alt . Player [ ] ;
186- return results . length >= 1 ? results [ 0 ] : undefined ;
185+ const results = alt . Utils . getClosestPlayer ( { pos : vehicle . pos , range } ) as alt . Player ;
186+ return results ? results : undefined ;
187187 }
188188
189189 /**
0 commit comments