oak.event('playerConnect',async pid => {console.log('[info] player connected', pid)oak.chatBroadcast(`[info] player ${awaitoak.playerNameGet(pid)} connected.`)oak.playerModelSet(pid,"Tommy.i3d")oak.playerPositionSet(pid, [-1774.59301758,-4.88487052917,-2.40491962433 ])oak.playerHealthSet(pid,200)oak.hudFadeout(pid,1,500,0xFFFFFF)oak.hudFadeout(pid,0,500,0xFFFFFF)oak.playerSpawn(pid)})
Player disconnect
playerDisconnect(pid)
Remarks
Happens when the player disconnects or times out.
There's no way to find out if the player timed out as of right now. This will be added later on.
Arguments
Type
Description
player
Player ID
oak.event('playerDisconnect',async pid => {oak.chatBroadcast(`[info] player ${awaitoak.playerNameGet(pid)} disconnected.`)})
Player death
playerDeath(pid)
Remarks
Arguments
Type
Description
player
Player ID
oak.event('playerDeath',async pid => {oak.chatSend(pid,`[info] you died! Get a new life!`)oak.playerModelSet(pid,"Tommy.i3d")oak.playerPositionSet(pid, [-1774.59301758,-4.88487052917,-2.40491962433 ])oak.playerHealthSet(pid,200)oak.hudFadeout(pid,1,500,0xFFFFFF)oak.hudFadeout(pid,0,500,0xFFFFFF)oak.playerSpawn(pid)})
Player hit
playerhit(pid, atkr, float)
Remarks
Happens when attacker lands a hit on another player.