Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. static Map_Pipes[ 4 ], bool: In_Use[ 4 ]
  2. static const Pipes_List[][] = {
  3. "pipe1",
  4. "pipe2",
  5. "pipe3",
  6. "pipe4"
  7. }
  8.  
  9. public plugin_init() {
  10. RegisterHam( Ham_Use, "func_button", "Ham_Use" )
  11. LoadMapEvents()
  12. }
  13.  
  14. public LoadMapEvents() {
  15. Map_Pipes[ 0 ] = engfunc( EngFunc_FindEntityByString, Map_Pipes[ 0 ], "targetname", "pipe1" )
  16. Map_Pipes[ 1 ] = engfunc( EngFunc_FindEntityByString, Map_Pipes[ 1 ], "targetname", "pipe2" )
  17. Map_Pipes[ 2 ] = engfunc( EngFunc_FindEntityByString, Map_Pipes[ 2 ], "targetname", "pipe3" )
  18. Map_Pipes[ 3 ] = engfunc( EngFunc_FindEntityByString, Map_Pipes[ 3 ], "targetname", "pipe4" )
  19. }
  20.  
  21. public Ham_Button( ent, idcaller, idactivator, use_type, Float:value ) {
  22. if( ent == Map_Pipes[ 0 ] ) In_Use[ 0 ] = false
  23. if( ent == Map_Pipes[ 1 ] ) In_Use[ 1 ] = false
  24. if( ent == Map_Pipes[ 2 ] ) In_Use[ 2 ] = false
  25. if( ent == Map_Pipes[ 3 ] ) In_Use[ 3 ] = false
  26. }
  27.  
  28. public test( iEnt ) { //======> Моя функция, где вызывается абилити
  29. static Random_Pipe
  30. Random_Pipe = random( charsmax( Map_Pipes ) )
  31. switch( Random_Pipe ) {
  32. case 0: In_Use[ 0 ] = true
  33. case 1: In_Use[ 1 ] = true
  34. case 2: In_Use[ 2 ] = true
  35. case 3: In_Use[ 3 ] = true
  36. }
  37. new ent = -1;
  38. while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "targetname", Pipes_List[ Random_Pipe ] ) ) > 0 ) {
  39. set_pev( Map_Pipes[ Random_Pipe ], pev_body, 1 )
  40. set_rendering( Map_Pipes[ Random_Pipe ], kRenderGlow, 255, 255, 255, kRenderFxFadeSlow, 150 )
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement