KAKAN

For anik #3

Apr 17th, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.43 KB | None | 0 0
  1. const MAX_SPHERES = 100;
  2. const TIME_TO_RESPAWN = 60; //in seconds.
  3.  
  4. a_sphere <- array( MAX_SPHERES, null );
  5.  
  6. function onSphereEntered( player, sphere )
  7. {
  8.     a_sphere[ sphere.ID ] = sphere;
  9.     NewTimer( "ReSpawn" , TIME_TO_RESPAWN*1000 , 1 , sphere.ID );
  10.     sphere.Remove();
  11. }
  12.  
  13. function ReSpawn( sID )
  14. {
  15.     local s = a_sphere[ sID ];
  16.     if( !s ) return;
  17.     CreateSphere( null, s.World, s.Pos, s.Color, s.Radius );
  18.     a_sphere[ sID ] = null;
  19. }
Add Comment
Please, Sign In to add comment