Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.92 KB | None | 0 0
  1. # -*- coding:Utf-8 -*-
  2. import es, playerviewlib
  3.  
  4.  
  5. if not es.exists("command", "playerview"):
  6.     es.regcmd("playerview", "wcs/tools/playerview/command", "playerview: get userid that player is aiming")
  7.  
  8. def command():
  9.     # check count of argument
  10.     if es.getargc() != 3: es.dbgmsg(0, 'Syntax: playerview <"entity" or "player"> <userid>')
  11.     else:
  12.         # get target type ("entity" or "player"), userid and viewplayer to execute
  13.         target, userid, viewplayer = es.getargv(1), es.getargv(2), es.getargv(3)
  14.  
  15.         # if target is "entity"
  16.         if target == "entity":
  17.             # get index of entity that player is aiming
  18.             player = playerviewlib.PlayerView(userid)
  19.             player.entity()
  20.  
  21.  
  22.         # if target is "player"
  23.         elif target == "player":
  24.             # get userid of player that player is aiming
  25.             player = playerviewlib.PlayerView(userid)
  26.             player.player()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement