Archived
upd
- added all non-jumping calls (cef <=> client, client <=> server) - added @ragempcommunity types (todo)
This commit is contained in:
1 parent
092693acb5
commit
f8dd4d9fce
14 files changed
+162
-103
No files matched your search
@@ -1,18 +1,11 @@
|
||||
import { fw } from 'rage-fw-server'
|
||||
import { rpc } from 'rpc'
|
||||
|
||||
fw.event.register('playerJoin', async ([player]) => {
|
||||
fw.system.log.info(`Connected: ${player.socialClub}`)
|
||||
rpc.register('playerJoin', async player => {
|
||||
console.log(`Connected: ${player.socialClub}`)
|
||||
})
|
||||
|
||||
fw.event.register('customServerEvent', async ([player, msg]) => {
|
||||
fw.system.log.info(player.socialClub + ' ' + msg)
|
||||
rpc.register('customServerEvent', (player, data) => {
|
||||
console.log(player, data)
|
||||
|
||||
const resFromCef = await fw.player.triggerBrowser(
|
||||
player,
|
||||
'customCefEvent',
|
||||
['from server'],
|
||||
)
|
||||
fw.system.log.info(player.socialClub + ' ' + resFromCef)
|
||||
|
||||
return 'from server'
|
||||
rpc.callClient(player, 'customClientEvent', ['server to client'])
|
||||
})
|
||||
Reference in new issue
Block a user