Skip to content

Commit

Permalink
feat(lib/client): CPlayer get method
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Jul 23, 2022
1 parent b2e7c61 commit 13429c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions lib/client/player.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const exp = exports.ox_core.CPlayer;

export class CPlayer {
coords: number[];
groups: Record<string, number>;
Expand Down Expand Up @@ -51,6 +53,10 @@ export class CPlayer {
}
}
}

get(key?: string): any {
return exp("get", key);
}
}

export let player: CPlayer | undefined = exports.ox_core.GetPlayerData();
Expand Down
8 changes: 4 additions & 4 deletions lib/server/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export class CPlayer {
return this.coords;
}

set(index: string, value: any) {
exp(this.source, "set", index, value);
set(key: string, value: any) {
exp(this.source, "set", key, value);
}

get(index?: string): any {
return exp(this.source, "get", index);
get(key?: string): any {
return exp(this.source, "get", key);
}

setGroup(name: string, grade: number) {
Expand Down

0 comments on commit 13429c6

Please sign in to comment.