Skip to content

Commit

Permalink
feat: added request class callback
Browse files Browse the repository at this point in the history
  • Loading branch information
dockfries committed Sep 27, 2022
1 parent af143aa commit f87f6a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/controllers/player/playerEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ abstract class AbstractPlayerEvent<P extends BasePlayer> {
newkeys: KeysEnum,
oldkeys: KeysEnum
): number;
protected abstract onRequestClass(player: P, classid: number): number;
protected abstract onRequestSpawn(player: P): number;
protected abstract onSpawn(player: P): number;
protected abstract onStateChange(
Expand Down Expand Up @@ -230,6 +231,12 @@ export abstract class BasePlayerEvent<
}
);

cbs.OnPlayerRequestClass((playerid: number, classid: number): number => {
const p = this.findPlayerById(playerid);
if (!p) return 0;
return this.onRequestClass(p, classid);
});

cbs.OnPlayerRequestSpawn((playerid: number): number => {
const p = this.findPlayerById(playerid);
if (!p) return 0;
Expand Down

0 comments on commit f87f6a1

Please sign in to comment.