Author Topic: help ulx, lua  (Read 281 times)

0 Members and 1 Guest are viewing this topic.

Offline $VDFOREVER

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
help ulx, lua
« on: July 27, 2020, 08:24:14 AM »
Help in lua, I'm a complete zero, I need to move there when I execute (sorry google translate)
Code: Lua
  1. local CATEGORY_NAME = "admin"
  2.  
  3. function ulx.adminzone(ply)
  4.  
  5.                                 local str = "#A tp admin zone"
  6.                                 ulx.fancyLogAdmin(ply, str)                    
  7.         end
  8.  
  9. local adminzone = ulx.command(CATEGORY_NAME, "ulx az", ulx.adminzone, "!az")
  10. adminzone:defaultAccess( ULib.ACCESS_ADMIN )
  11. adminzone:help( "tp admin zone" )
  12.  
  13.  
  14.  
  15. function adminzone(ply)
  16.  
  17.         ply:SetPos(Vector(-1244.353638, 1044.383301, 80.597824)) -- admin zone position
  18. end

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2729
  • Karma: 427
    • |G4P| Gman4President
Re: help ulx, lua
« Reply #1 on: July 29, 2020, 05:51:21 PM »
Code: Lua
  1. local CATEGORY_NAME = "admin"
  2.  
  3. function ulx.adminzone(ply)
  4.         local str = "#A tp admin zone"
  5.         ulx.fancyLogAdmin(ply, str)
  6.         adminzone( ply )       
  7. end
  8. local adminzone = ulx.command(CATEGORY_NAME, "ulx az", ulx.adminzone, "!az")
  9. adminzone:defaultAccess( ULib.ACCESS_ADMIN )
  10. adminzone:help( "tp admin zone" )
  11.  
  12.  
  13.  
  14. function adminzone( ply )
  15.         ply:SetPos(Vector(-1244.353638, 1044.383301, 80.597824)) -- admin zone position
  16. end
  17.  

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2729
  • Karma: 427
    • |G4P| Gman4President
Re: help ulx, lua
« Reply #2 on: July 29, 2020, 05:52:07 PM »
You were close. You just needed to call that function you created to teleport the player.