Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' HANDLE PACKET SUB
  2. public sub HandlePlayerDied()
  3.     dim buffer as clsBuffer
  4.     set buffer = new clsBuffer
  5.    
  6.     buffer.WriteBytes Data()
  7.    
  8.     ' Set the player respawn timer to be the value we're told to wait.
  9.     PlayerRespawnTimer = buffer.ReadLong
  10. end sub
  11.  
  12.  
  13.  
  14.  
  15.  
  16. ' GAME LOOP LOGIC STUFF
  17.  
  18. public PlayerRespawnTimer as long
  19.  
  20. public sub GameLoop()
  21.  
  22.     do
  23.    
  24.         ' One second has passed.
  25.         if tmr1000 < tick then
  26.        
  27.             if (PlayerRespawnTimer > 0) then
  28.                 PlayerRespawnTimer = PlayerRespawnTimer - 1
  29.             end if
  30.        
  31.             ' Update the one-second tick.
  32.             tmr1000 = tick + 1000
  33.         end if
  34.    
  35.     while (true)
  36.  
  37. end sub
  38.  
  39.  
  40.  
  41. ' MOD GRAPHICS or whatever you're using
  42. public sub DrawGame()
  43.  
  44.     if (PlayerRespawnTimer > 0) then
  45.         ' DrawText "Respawning in: " + PlayerRespawnTimer + " seconds..."
  46.     else
  47.         ' The usual draw-game stuff here.
  48.     end if
  49. end sub
  50.  
  51.  
  52. public sub GetButtonInput()
  53.     ' Make sure that the client doesn't let them even TRY to move when they're respawning.
  54.     if (PlayerRespawnTimer <= 0) then
  55.         ' Code for detecting buttons for movement, talking, etc.
  56.     end if
  57. end sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement