WarCraft: Source

 

GetViewCoord

Page history last edited by freddukes@... 1 yr ago

Get View Coord


This command gets the co-ordinates of where the user is looking. When the command is run, it will execute a python method and pass over the 3 variables.

 

The following syntax is:

 

wcs.Command(<userid>).GetViewCoord(<callback-function>, [Optional: Additional parameters])

 

  • Userid - The userid you wish to retrieve the view co-ords of.
  • Callback-Function - The function that will be run when the view-coord command has activated.
  • Optional: additonal parameters - Pass any other parameters you want to pass to the other method here.

 


 

Example:

 

def player_say(ev):

    if ev["text"] == "Where am I looking?":

        wcs.Command(ev["userid"]).GetViewCoord(msgLooking, ev['userid'])

 

def msgLooking(userid, x, y, z):

    # The method takes 4 parameters... userid, x, y, z.. If any additional parameters were send in the GetViewCoord() command, then this method must accept a 5th parameter which will be a list of all your parameters you passed.

    es.tell(userid, 'You are looking at: X: %s - Y: %s - Z: %s' % (x,y,z) )

Comments (0)

You don't have permission to comment on this page.