Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- import es
- import spe_effects
- from playerlib import getPlayer
- def player_jump(ev):
- # Call the example function
- armorRicochet(int(ev['userid']))
- def armorRicochet(userid):
- '''
- Creates an armor ricochet with a random direction in the near of the given
- user ID.
- '''
- spe_effects.armorRicochet(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- tuple(randint(0, 10) for x in xrange(3)) # vDirection
- )
- def radioIcon(userid):
- '''
- Creates an exclamation mark above the player's head.
- '''
- spe_effects.radioIcon(
- '#all', # users
- 0, # fDelay
- userid, # iUserID
- )
- def beamEntPoint(userid):
- '''
- Connects the player with a laser beam.
- '''
- spe_effects.beamEntPoint(
- '#all', # users
- 0, # fDelay
- getPlayer(userid).index, # iStartEntityIndex
- 0, # vStartOrigin
- 0, # iEndEntityIndex
- es.getplayerlocation(userid), # vEndOrigin
- 'sprites/laser.vmt', # szModelPath
- 0, # iHaloIndex
- 0, # iStartFrame
- 255, # iFrameRate
- 5, # fLife
- 3, # fWidth
- 3, # fEndWidth
- 0, # fFadeLength
- 5, # fAmplitude
- randint(0, 255), # iRed
- randint(0, 255), # iGreen
- randint(0, 255), # iBlue
- 255, # iAlpha
- 1, # iSpeed
- )
- def beamEnts(userid):
- '''
- Connects the given user ID with another player by a laser beam.
- '''
- other = getOtherPlayer(userid)
- if not other:
- return es.tell(userid, 'No other player found.')
- spe_effects.beamEnts(
- '#all', # users
- 0, # fDelay
- getPlayer(userid).index, # iStartEntityIndex
- getPlayer(other).index, # iEndEntityIndex
- 'sprites/laser.vmt', # szModelPath
- 0, # iHaloIndex
- 0, # iStartFrame
- 255, # iFrameRate
- 3, # fLife
- 3, # fWidth
- 0, # fEndWidth
- 0, # fFadeLength
- 0, # fAmplitude
- randint(0, 255), # iRed
- randint(0, 255), # iGreen
- randint(0, 255), # iBlue
- 255, # iAlpha
- 1, # iSpeed
- )
- def beamFollow(userid):
- '''
- Creates a following laser beam.
- '''
- spe_effects.beamFollow(
- '#all', # users
- 0, # fDelay
- getPlayer(userid).index, # iEntityIndex
- 'sprites/laser.vmt', # szModelPath
- 0, # iHaloIndex
- 2, # fLife
- 3, # fWidth
- 3, # fEndWidth
- 0, # fFadeLength
- randint(0, 255), # iRed
- randint(0, 255), # iGreen
- randint(0, 255), # iBlue
- 255 # iAlpha
- )
- def beamPoints(userid):
- '''
- Creates a laser beam in the near of the given player.
- '''
- origin1 = es.getplayerlocation(userid)
- origin2 = tuple(x+100 for x in origin1)
- spe_effects.beamPoints(
- '#all', # users
- 0, # fDelay
- origin1, # vStartOrigin
- origin2, # vEndOrigin
- 'sprites/laser.vmt', # szModelPath
- 0, # iHaloIndex
- 0, # iStartFrame
- 255, # iFrameRate
- 3, # fLife
- 3, # fWidth
- 3, # fEndWidth
- 0, # fFadeLength
- 0, # fAmplitude
- randint(0, 255), # iRed
- randint(0, 255), # iGreen
- randint(0, 255), # iBlue
- 255, # iAlpha
- 1, # iSpeed
- )
- def beamRing(userid):
- '''
- Connects the given player with another player by a beam ring.
- '''
- other = getOtherPlayer(userid)
- if not other:
- return es.tell(userid, 'No other player found.')
- spe_effects.beamRing(
- '#all', # users
- 0, # fDelay
- getPlayer(userid).index, # iStartEntityIndex
- getPlayer(other).index, # iEndEntityIndex
- 'sprites/laser.vmt', # szModelPath
- 0, # iHaloIndex
- 0, # iStartFrame
- 255, # iFrameRate
- 3, # fLife
- 3, # fWidth
- 0, # iSpread
- 5, # fAmplitude
- randint(0, 255), # iRed
- randint(0, 255), # iGreen
- randint(0, 255), # iBlue
- 255, # iAlpha
- 1, # iSpeed
- 0, # iFlags
- )
- def beamRingPoint(userid):
- '''
- Creates an expanding ring at the players location.
- '''
- spe_effects.beamRingPoint(
- '#all', # users
- 0, # fDelay
- es.getplayerlocation(userid), # vOrigin
- 0, # fStartRadius
- 500, # fEndRadius
- 'sprites/fire.vmt', # szModelPath
- 0, # iHaloIndex
- 0, # iStartFrame
- 255, # iFrameRate
- 3, # fLife
- 3, # fWidth
- 0, # iSpread
- 0, # fAmplitude
- randint(0, 255), # iRed
- randint(0, 255), # iGreen
- randint(0, 255), # iBlue
- 255, # iAlpha
- 1, # iSpeed
- 0, # iFlags
- )
- def bloodSprite(userid):
- '''
- Creates a blood sprite in the near of the given player.
- '''
- spe_effects.bloodSprite(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- (0, 0, 0), # vDirection
- randint(0, 255), # iRed
- randint(0, 255), # iGreen
- randint(0, 255), # iBlue
- 255, # iAlpha
- 1, # iSize
- )
- def bloodStream(userid):
- '''
- Creates a colored blood stream in the near of the player. Somehow the
- texture is pick/black.
- '''
- spe_effects.bloodStream(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- (0, 0, 0), # vDirection
- randint(0, 255), # iRed
- randint(0, 255), # iGreen
- randint(0, 255), # iBlue
- 255, # iAlpha
- 10, # iAmount
- )
- def breakModel(userid):
- '''
- Creates the wooden barrels in the near of the given player.
- '''
- spe_effects.breakModel(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- (0, 0, 0), # vAngle
- (1, 1, 1), # vSize
- (10, 10, 10), # vVelocity
- 'models/props_c17/woodbarrel001.mdl', # szModelPath
- 300, # iRandomization
- 3, # iCount
- 3, # fTime
- 0, # iFlags
- )
- def bubbleTrail(userid):
- '''
- Creates a line of bubbles in the near of the given player.
- '''
- origin1 = es.getplayerlocation(userid)
- origin2 = tuple(x+200 for x in origin1)
- spe_effects.bubbleTrail(
- '#all', # users
- 0, # fDelay
- origin1, # vStartOrigin
- origin2, # vEndOrigin
- 200, # fWaterlevel
- 'sprites/bubble.vmt', # szModelPath
- 100, # iCount
- 1, # fSpeed
- )
- def bubbles(userid):
- '''
- Creates some laser balls in the near of the given player.
- '''
- origin1 = es.getplayerlocation(userid)
- origin2 = tuple(x+100 for x in origin1)
- spe_effects.bubbles(
- '#all', # users
- 0, # fDelay
- origin1, # vStartOrigin
- origin2, # vEndOrigin
- 200, # fHeight
- 'sprites/strider_blackball.vmt', # szModelPath
- 100, # iCount
- 75, # fSpeed
- )
- def dust(userid):
- '''
- Creates a dust clound in the near of the given player.
- '''
- spe_effects.dust(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- (0, 0, 0), # vDirection
- 100, # fSize
- 1, # fSpeed
- )
- def dynamicLight(userid):
- '''
- Creates a random colored light in the near of the given player.
- '''
- spe_effects.dynamicLight(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- randint(0, 255), # iRed
- randint(0, 255), # iGreen
- randint(0, 255), # iBlue
- 6, # iExponent
- 600, # fRadius
- 5, # fTime
- 3, # fDecay
- )
- def energySplash(userid):
- '''
- Creates an energy splash in the near of the given player.
- '''
- spe_effects.energySplash(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- tuple(randint(0, 100) for x in xrange(3)), # vDirection
- 1, # bExplode
- )
- def explosion(userid):
- '''
- Creates an explosion in the near of the given player.
- '''
- spe_effects.explosion(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- 0, # iModelIndex
- 1, # fScale
- 255, # iFrameRate
- 0, # iFlags
- 300, # iRadius
- 1, # iMagnitude
- 0, # vNormal
- 'C', # szMaterialType
- )
- def glowSprite(userid):
- '''
- Creates a blue glow sprite at the player's location.
- '''
- spe_effects.glowSprite(
- '#all', # users
- 0, # fDelay
- es.getplayerlocation(userid), # vOrigin
- 'sprites/blueglow2.vmt', # szModelPath
- 5, # fLife
- 3, # fSize
- 255, # iBrightness
- )
- def largeFunnel(userid):
- '''
- Creates a large funnel in the near of the player.
- '''
- spe_effects.largeFunnel(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- 0, # szModelPath
- 1, # iReversed
- )
- def metalSparks(userid):
- '''
- Creates some metal sparks in the near of the given player.
- '''
- spe_effects.metalSparks(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- (randint(0, 100) for x in xrange(3)), # vDirection
- )
- def muzzleFlash(userid):
- '''
- Creates a cool muzzle flash in the near of the given player.
- '''
- spe_effects.muzzleFlash(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- (0, 0, 0), # vAngles
- 1, # fScale
- 4, # iType
- )
- def physicsProp(userid):
- '''
- Creates a wooden barrel, which is pushed away.
- '''
- spe_effects.physicsProp(
- '#all', # users
- 0, # fDelay
- 'models/props_c17/woodbarrel001.mdl', # szModelPath
- 1, # iSkin
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- (90, 90, 0), # vAngles
- (200, 200, 0), # vVelocity
- 0, # iFlags
- 0, # iEffects
- )
- def shatterSurface(userid):
- '''
- Creates broken glass in the near of the player.
- '''
- spe_effects.shatterSurface(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- (0, 0, 0), # vAngle
- (0, 0, 0), # vForce
- (0, 0, 0), # vForceOrigin
- 100, # fWidth
- 100, # fHeight
- 10, # fShardsize
- 0, # iSurfacetype
- 0, # iFrontR
- randint(0, 255), # iFrontG
- randint(0, 255), # iFrontB
- randint(0, 255), # iBackR
- randint(0, 255), # ibackG
- randint(0, 255) # ibackB
- )
- def showLine(userid):
- '''
- Creates a beam. Somehow the texture is pink/black.
- '''
- origin1 = es.getplayerlocation(userid)
- origin2 = (origin1[0]+100, origin1[1]+100, origin1[2])
- spe_effects.showLine(
- '#all', # users
- 0, # fDelay
- origin1, # vStartOrigin
- origin2 # vEndOrigin
- )
- def smoke(userid):
- '''
- Creates a smoke cloud in the near of the player.
- '''
- spe_effects.smoke(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- 0, # iModelIndex
- 10, # fScale
- 255 # iFrameRate
- )
- def sparks(userid):
- '''
- Creates some sparks in the near of the given player.
- '''
- spe_effects.sparks(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- 2, # iMagnitude
- 1, # iTrailLength
- (randint(0, 100) for x in xrange(3)) # vDirection
- )
- def sprite(userid):
- '''
- Creates an animated glow sprite in the near of the given player.
- '''
- spe_effects.sprite(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- 'sprites/animglow01.vmt', # szModelPath
- 2, # fSize
- 255, # iBrightness
- )
- def spriteSpray(userid):
- '''
- Creates a couple of bubbles, which are pushed in a random direction.
- '''
- spe_effects.spriteSpray(
- '#all', # users
- 0, # fDelay
- tuple(x+100 for x in es.getplayerlocation(userid)), # vOrigin
- tuple(randint(0, 100) for x in xrange(3)), # vDirection
- 'sprites/bubble.vmt', # szModelPath
- 10, # iSpeed
- 1, # fNoise
- 7, # iCount
- )
- def worldDecal(userid):
- '''
- Creates a small crate at the player's location.
- '''
- spe_effects.worldDecal(
- '#all', # users
- 0, # fDelay
- es.getplayerlocation(userid), # vOrigin
- 'decals/decal_crater001a.vmt', # szModelPath
- )
- def getOtherPlayer(userid):
- userid = int(userid)
- for player in es.getUseridList():
- if userid != player:
- return player
Advertisement
Add Comment
Please, Sign In to add comment