Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static Map_Pipes[ 4 ], bool: In_Use[ 4 ]
- static const Pipes_List[][] = {
- "pipe1",
- "pipe2",
- "pipe3",
- "pipe4"
- }
- public plugin_init() {
- RegisterHam( Ham_Use, "func_button", "Ham_Use" )
- LoadMapEvents()
- }
- public LoadMapEvents() {
- Map_Pipes[ 0 ] = engfunc( EngFunc_FindEntityByString, Map_Pipes[ 0 ], "targetname", "pipe1" )
- Map_Pipes[ 1 ] = engfunc( EngFunc_FindEntityByString, Map_Pipes[ 1 ], "targetname", "pipe2" )
- Map_Pipes[ 2 ] = engfunc( EngFunc_FindEntityByString, Map_Pipes[ 2 ], "targetname", "pipe3" )
- Map_Pipes[ 3 ] = engfunc( EngFunc_FindEntityByString, Map_Pipes[ 3 ], "targetname", "pipe4" )
- }
- public Ham_Button( ent, idcaller, idactivator, use_type, Float:value ) {
- if( ent == Map_Pipes[ 0 ] ) In_Use[ 0 ] = false
- if( ent == Map_Pipes[ 1 ] ) In_Use[ 1 ] = false
- if( ent == Map_Pipes[ 2 ] ) In_Use[ 2 ] = false
- if( ent == Map_Pipes[ 3 ] ) In_Use[ 3 ] = false
- }
- public test( iEnt ) { //======> Моя функция, где вызывается абилити
- static Random_Pipe
- Random_Pipe = random( charsmax( Map_Pipes ) )
- switch( Random_Pipe ) {
- case 0: In_Use[ 0 ] = true
- case 1: In_Use[ 1 ] = true
- case 2: In_Use[ 2 ] = true
- case 3: In_Use[ 3 ] = true
- }
- new ent = -1;
- while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "targetname", Pipes_List[ Random_Pipe ] ) ) > 0 ) {
- set_pev( Map_Pipes[ Random_Pipe ], pev_body, 1 )
- set_rendering( Map_Pipes[ Random_Pipe ], kRenderGlow, 255, 255, 255, kRenderFxFadeSlow, 150 )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement