1- import { sleep , waitFor } from " @overextended/ox_lib" ;
2- import { cache , inputDialog } from " @overextended/ox_lib/client" ;
3- import { OxPlayer } from " ./player" ;
4- import { netEvent } from " utils" ;
5- import { CHARACTER_SELECT , SPAWN_LOCATION } from " config" ;
6- import locale from " ../common/locales" ;
7- import type { Character , NewCharacter } from " types" ;
1+ import { sleep , waitFor } from ' @overextended/ox_lib' ;
2+ import { cache , inputDialog } from ' @overextended/ox_lib/client' ;
3+ import { OxPlayer } from ' ./player' ;
4+ import { netEvent } from ' utils' ;
5+ import { CHARACTER_SELECT , SPAWN_LOCATION } from ' config' ;
6+ import locale from ' ../common/locales' ;
7+ import type { Character , NewCharacter } from ' types' ;
88
99DoScreenFadeOut ( 0 ) ;
1010NetworkStartSoloTutorialSession ( ) ;
11- setTimeout ( ( ) => emitNet ( " ox:playerJoined" ) ) ;
11+ setTimeout ( ( ) => emitNet ( ' ox:playerJoined' ) ) ;
1212
1313async function StartSession ( ) {
1414 if ( IsPlayerSwitchInProgress ( ) ) {
@@ -42,11 +42,11 @@ async function StartSession() {
4242 SetPlayerHealthRechargeMultiplier ( cache . playerId , 0.0 ) ;
4343}
4444
45- netEvent ( " ox:startCharacterSelect" , async ( _userId : number , characters : Character [ ] ) => {
45+ netEvent ( ' ox:startCharacterSelect' , async ( _userId : number , characters : Character [ ] ) => {
4646 if ( OxPlayer . isLoaded ) {
4747 OxPlayer . isLoaded = false ;
4848
49- emit ( " ox:playerLogout" ) ;
49+ emit ( ' ox:playerLogout' ) ;
5050 }
5151
5252 StartSession ( ) ;
@@ -73,55 +73,55 @@ netEvent("ox:startCharacterSelect", async (_userId: number, characters: Characte
7373 DoScreenFadeIn ( 200 ) ;
7474
7575 if ( character ) {
76- return emitNet ( " ox:setActiveCharacter" , character . charId ) ;
76+ return emitNet ( ' ox:setActiveCharacter' , character . charId ) ;
7777 }
7878
7979 const input = await inputDialog (
80- locale ( " create_character" ) ,
80+ locale ( ' create_character' ) ,
8181 [
8282 {
83- type : " input" ,
83+ type : ' input' ,
8484 required : true ,
85- icon : " user-pen" ,
86- label : locale ( " firstname" ) ,
87- placeholder : " John" ,
85+ icon : ' user-pen' ,
86+ label : locale ( ' firstname' ) ,
87+ placeholder : ' John' ,
8888 } ,
8989 {
90- type : " input" ,
90+ type : ' input' ,
9191 required : true ,
92- icon : " user-pen" ,
93- label : locale ( " lastname" ) ,
94- placeholder : " Smith" ,
92+ icon : ' user-pen' ,
93+ label : locale ( ' lastname' ) ,
94+ placeholder : ' Smith' ,
9595 } ,
9696 {
97- type : " select" ,
97+ type : ' select' ,
9898 required : true ,
99- icon : " circle-user" ,
100- label : locale ( " gender" ) ,
99+ icon : ' circle-user' ,
100+ label : locale ( ' gender' ) ,
101101 options : [
102102 {
103- label : locale ( " male" ) ,
104- value : " male" ,
103+ label : locale ( ' male' ) ,
104+ value : ' male' ,
105105 } ,
106106 {
107- label : locale ( " female" ) ,
108- value : " female" ,
107+ label : locale ( ' female' ) ,
108+ value : ' female' ,
109109 } ,
110110 {
111- label : locale ( " non_binary" ) ,
112- value : " non_binary" ,
111+ label : locale ( ' non_binary' ) ,
112+ value : ' non_binary' ,
113113 } ,
114114 ] ,
115115 } ,
116116 {
117- type : " date" ,
117+ type : ' date' ,
118118 required : true ,
119- icon : " calendar-days" ,
120- label : locale ( " date_of_birth" ) ,
121- format : " YYYY-MM-DD" ,
122- min : " 1900-01-01" ,
123- max : " 2006-01-01" ,
124- default : " 2006-01-01" ,
119+ icon : ' calendar-days' ,
120+ label : locale ( ' date_of_birth' ) ,
121+ format : ' YYYY-MM-DD' ,
122+ min : ' 1900-01-01' ,
123+ max : ' 2006-01-01' ,
124+ default : ' 2006-01-01' ,
125125 } ,
126126 ] ,
127127 {
@@ -131,28 +131,28 @@ netEvent("ox:startCharacterSelect", async (_userId: number, characters: Characte
131131
132132 if ( ! input ) return ;
133133
134- emitNet ( " ox:setActiveCharacter" , < NewCharacter > {
134+ emitNet ( ' ox:setActiveCharacter' , < NewCharacter > {
135135 firstName : input [ 0 ] as string ,
136136 lastName : input [ 1 ] as string ,
137137 gender : input [ 2 ] as string ,
138138 date : input [ 3 ] as number ,
139139 } ) ;
140140} ) ;
141141
142- netEvent ( " ox:setActiveCharacter" , async ( character : Character ) => {
142+ netEvent ( ' ox:setActiveCharacter' , async ( character : Character ) => {
143143 if ( CHARACTER_SELECT ) {
144144 SwitchInPlayer ( PlayerPedId ( ) ) ;
145145 SetGameplayCamRelativeHeading ( 0 ) ;
146146 }
147147
148- await waitFor ( ( ) => ( IsScreenFadedIn ( ) && ! IsPlayerSwitchInProgress ( ) ? true : undefined ) , "" , 0 ) ;
148+ await waitFor ( ( ) => ( IsScreenFadedIn ( ) && ! IsPlayerSwitchInProgress ( ) ? true : undefined ) , '' , 0 ) ;
149149
150150 SetEntityHealth ( cache . ped , character . health ?? GetEntityMaxHealth ( cache . ped ) ) ;
151151 SetPedArmour ( cache . ped , character . armour ?? 0 ) ;
152152 FreezeEntityPosition ( cache . ped , false ) ;
153153
154154 OxPlayer . isLoaded = true ;
155155
156- emit ( " playerSpawned" ) ;
157- emit ( " ox:playerLoaded" , OxPlayer , character . isNew ) ;
156+ emit ( ' playerSpawned' ) ;
157+ emit ( ' ox:playerLoaded' , OxPlayer , character . isNew ) ;
158158} ) ;
0 commit comments