It's just a wrapper around some SP modules and their functions. I'm still discovering what SP lets us do at the current state, so I will keep updating this.
Functions:
Syntax: Select all
import ezsp as ez
ez.getindex(userid)
# returns the player's index by userid
##
# Functions that need <index> as argument
##
ez.getuserid(index)
# returns the player's userid
ez.getplayername(index)
# returns the player's name
ez.getplayersteamid(index)
# returns the player's steamid
ez.getplayerpointer(index)
# returns the player's pointer instance
ez.getplayerinfo(index)
# returns the player's playerinfo instance
ez.getplayerhandle(index)
# returns the player's handle
ez.getplayerlocation(index)
# returns the player's location as a mathlib.Vector instance
ez.getplayerteam(index)
# returns the player's team (0,1,2,3)
ez.gethealth(index)
# returns the player's health
ez.getarmor(index)
# returns the player's armor
ez.getmodel(index)
# returns the player's model name
ez.getcolor(index)
# returns the player's model color in RGBA format
ez.getlanguage(index)
# returns the player's cl_language variable
ez.isdead(index)
# returns True if the player is dead, else False
ez.iscrouched(index)
# returns True if the player is crouching, else False
ez.getviewcoordinated(index)
# returns the player's view coordinates
ez.geteyelocation(index)
# returns the player's eye location
ez.getviewvector(index)
# returns the payer's view vector
ez.getcvarvalue(index, cvar)
# returns a player's cvar value (e.g. cl_cmdrate)
ez.getvelocity(index)
# returns the player's velocity
ez.getspeed(index)
# returns the player's speed multiplier
ez.getnoclip(index)
# returns True if player in noclip, else False
ez.getnoblock(index)
# returns True if player has noblock, else False
ez.getjetpack(index)
# returns True if player has jetpack, else False
ez.getfreeze(index)
# returns True if player is frozen, else Flase
ez.getgodmode(index)
# returns True if player is in godmode, else False
ez.gethelmet(index)
# returns True if player has a helmet, else False
ez.getnearplayers(index, distance):
# returns a list of indexes of players that are within the given distance
ez.getclosestplayer(index)
# returns the distance and index of the closest player, will return (None,None) if there is none
ez.getweaponindex(index, weapon)
# returns the weapon index that is held by the player, will return 0 if the player doesn't have that weapon
ez.getweaponindexes(index)
# returns a list with all weapon indexes that are held by the player
ez.changeteam(index, team)
# changes the team (player will die if alive)
ez.sethealth(index, value)
# sets the health the player
ez.setspeed(index, value)
# sets the speed multiplier
ez.setmodel(index, model)
# precaches & sets the model
ez.setcolor(index, r, g, b, a=None)
# sets the model color (alpha does not work in csgo)
ez.setnoclip(index, value)
# set value parameter to 1 to turn noclip on, 0 to turn off
ez.setnoblock(index, value)
# set value parameter to 1 to turn noblock on, 0 to turn off
ez.setjetpack(index, value)
# set value parameter to 1 to turn jetpack on, 0 to turn off
ez.setfreeze(index, value)
# set value parameter to 1 to freeze, 0 to unfreeze
ez.setgodmode(index, value)
# set value parameter to 1 to turn godmode on, 0 to turn off
ez.flash(index, alpha, duration)
# blind a player like a flashbang --- does not work in csgo???
ez.sethelmet(index, value)
# set value parameter to 1 to give helmet, 0 to remove
ez.clientcommand(index, command)
# forces a player to execute a client command
##
# Other functions
##
ez.getplayercount()
# returns the number of players and bots
ez.gethumancount()
# returns the number of players
ez.getbotcount()
# returns the number of bots
ez.getalivecount()
# returns the number of alive players and bots
ez.getdeadcount()
# returns the number of dead players and bots
ez.precachemodel(model)
# precaches a model and returns its index
ez.precachedecal(decal)
# precaches a decal and returns its index
ez.createbot(name)
# creates a fake client with the given name
ez.drawline(start, end, model="sprites/laserbeam.vmt", halo="sprites/halo.vmt", startframe=0, framerate=1, life=1, width=5, endwidth=5, fadelength=5, amplitude=0, red=255, green=0, blue=0, alpha=255, speed=0)
# draws a line for every player --- start & end parameters must be mathlib.Vector() instances!
# model & halo will be precached
ez.drawcircle(center, start_radius=0, end_radius=250, model="sprites/laserbeam.vmt", halo="sprites/halo.vmt", startframe=0, framerate=255, life=1, width=5, spread=0, amplitude=0, red=255, green=0, blue=0, alpha=255, speed=1, flags=0)
# draws a circle for every player --- center parameter must be a mathlib.Vector() instance!
# model & halo will be precached
##
# Messages
##
ez.tell(index, message)
# print a SayText2 message to the player
ez.msg(message)
# print a SayText2 message to everyone
ez.hudhint(message)
# show a HintText message to everyone
I've tested the functions currently only in CS:GO.
Please provide any feedback, bugs or requests!
Download: