GerNearCoordList
This command retrieves Every user inside the X,Y,Z range, and stores them inside a list. It does the same function as NearCoord, except instead of returning a function for every user that it picks up, it adds them to a list and returns the list. The list will then contain every user's ID inside the range... An example of a list would look like this: ["2","5","13"] where the numbers are userID's.
The correct syntax is:
<variable> = wcs.Command(<userid>).GetNearCoordList(<x origin>, <y origin>, <z origin>, <x range>, <y range>, <z range>, [optional: Identifier])
- Variable - The local variable where the list will be returned to
- Userid - If you're running the near coord from for example a skill that's created by the userid, then that would be the userid... It's the person 'running' the command
- X, Y, Z origin - The co-ordinates the the ranges will be tested from
- X, Y, Z range - The range of which the users will have to be inside to return the call-back function
- Optional: Identifier - The target/Group of people that will be test; if none given, it will test all:
- #all - all players
- #ct - counter-terrorists
- #t - terrorists
- #spec - spectators
- #un - unassigned (people who never joined a team or spec after connecting)
- #dead - dead players
- #alive - living players
- #human - real players
- #bot - bots
Example:
def player_ultimate_on(ev):
x,y,z = es.getplayerlocation(ev['userid'])
# Get the position of the player
ident = '#t'
if es.getplayerteam(ev['userid']) == 3: ident = '#ct'
# These two lines makes sure that the ident now equals the same team that the player is on
near_list = wcs.Command(ev['userid']).GetNearCoordList(x,y,z,500,500,1000,ident)
# Near list now contains all of the team mates in a 500/500/1000 range of the player who ran the ultimate
for player in near_list:
# For every player inside the list
wcs.Command(player).Heal(50)
# Add 50 to their health
Comments (0)
You don't have permission to comment on this page.