Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' HANDLE PACKET SUB
- public sub HandlePlayerDied()
- dim buffer as clsBuffer
- set buffer = new clsBuffer
- buffer.WriteBytes Data()
- ' Set the player respawn timer to be the value we're told to wait.
- PlayerRespawnTimer = buffer.ReadLong
- end sub
- ' GAME LOOP LOGIC STUFF
- public PlayerRespawnTimer as long
- public sub GameLoop()
- do
- ' One second has passed.
- if tmr1000 < tick then
- if (PlayerRespawnTimer > 0) then
- PlayerRespawnTimer = PlayerRespawnTimer - 1
- end if
- ' Update the one-second tick.
- tmr1000 = tick + 1000
- end if
- while (true)
- end sub
- ' MOD GRAPHICS or whatever you're using
- public sub DrawGame()
- if (PlayerRespawnTimer > 0) then
- ' DrawText "Respawning in: " + PlayerRespawnTimer + " seconds..."
- else
- ' The usual draw-game stuff here.
- end if
- end sub
- public sub GetButtonInput()
- ' Make sure that the client doesn't let them even TRY to move when they're respawning.
- if (PlayerRespawnTimer <= 0) then
- ' Code for detecting buttons for movement, talking, etc.
- end if
- end sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement