WarCraft: Source

 

GetViewPlayer

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

Get View Player


This retrieves if the user is looking at another player. It then runs the callback function, passing the parmaeters userid and target. This method will ONLY run if the player is looking at another player.

 

The correct syntax is:

 

wcs.Command(<userid>).GetViewPlayer(<Callback-Function>, [Optional: Additonal Parameters])

 

  • Userid - The userid you wish to test to see if he's looking at somone.
  • Callback-Function - The function that will be run when the command has activated.
  • Optional: additonal parameters - Pass any other parameters you want to pass to the other method here.

 


 

Example:

 

def player_spawn(ev):

    wcs.Command(ev["userid"]).GetViewPlayer(msgPlayer)

 

def msgPlayer(userid, target)

    target_name = es.getplayername(target)

    user_name    = es.getplayername(userid)

    es.msg('Player %s is looking at player %s' % (user_name, target_name) )

Comments (0)

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