ULX

Author Topic: ulx thirdperson help  (Read 3976 times)

0 Members and 5 Guests are viewing this topic.

Offline C.Finley

  • Newbie
  • *
  • Posts: 36
  • Karma: 0
ulx thirdperson help
« on: June 15, 2016, 10:54:53 AM »
Its in the uncategorized category how to fix that and put it in a category.
Code: [Select]
if ( CLIENT ) then

local on = false -- default off

local function toggle()

on = !on

if on == true then

print( 'enabled' )

LocalPlayer():PrintMessage( HUD_PRINTTALK, "Third person mode enabled." )

else

print( 'disabled')

LocalPlayer():PrintMessage( HUD_PRINTTALK, "Third person mode disabled." )

end

end


hook.Add( "ShouldDrawLocalPlayer", "ThirdPersonDrawPlayer", function()

if on and LocalPlayer():Alive() then

return true

end

end )

hook.Add( "CalcView", "ThirdPersonView", function( ply, pos, angles, fov )

if on and ply:Alive() then

local view = {}
view.origin = pos - ( angles:Forward() * 70 ) + ( angles:Right() * 20 ) + ( angles:Up() * 5 )
--view.origin = pos - ( angles:Forward() * 70 )
view.angles = ply:EyeAngles() + Angle( 1, 1, 0 )
view.fov = fov

return GAMEMODE:CalcView( ply, view.origin, view.angles, view.fov )

end

end )

concommand.Add( "thirdperson_toggle", toggle )

end

if ( SERVER ) then

function ulx.thirdperson( calling_ply )

calling_ply:SendLua([[RunConsoleCommand("thirdperson_toggle")]])

end
local thirdperson = ulx.command( "Utility", "ulx thirdperson", ulx.thirdperson, {"!thirdperson", "!3p"}, true )
thirdperson:defaultAccess( ULib.ACCESS_ALL )
thirdperson:help( "Toggles third person mode" )

end -- end serverside

Offline OpticPotatOS

  • Jr. Member
  • **
  • Posts: 53
  • Karma: 0
  • GLaDOS
    • Gaming for Everyone
Re: ulx thirdperson help
« Reply #1 on: June 15, 2016, 01:35:02 PM »
I'm not sure if you can, but if you can, you need to stick a category name at the top and in the ulx.command variable
My website isn't my website, rather, it's the gaming network my sever is connected to.

ttt.gfe.nu

Unforeseen Consequences

Offline C.Finley

  • Newbie
  • *
  • Posts: 36
  • Karma: 0
Re: ulx thirdperson help
« Reply #2 on: June 15, 2016, 01:41:31 PM »
i added a local category name and then changed the "Utility" to CATEGORY_NAME and still didnt work can u tell me which part maybe i did it wrong cause it still didnt work. Or I'm confused.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: ulx thirdperson help
« Reply #3 on: June 15, 2016, 02:17:57 PM »
I'm not sure if you can, but if you can, you need to stick a category name at the top and in the ulx.command variable
You don't; this is merely stylistic.

@C.Finley - You shouldn't be defining and registering your command on the server only. ULX commands should be registered on both the client and the server.
bw81@ulysses-forums ~ % whoami
Homepage

Offline C.Finley

  • Newbie
  • *
  • Posts: 36
  • Karma: 0
Re: ulx thirdperson help
« Reply #4 on: June 15, 2016, 02:24:55 PM »
All I wanna do is have that ulx thirdperson within a group category instead of uncategorized can you tell me how to do that? bytewave? or can I not ?

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: ulx thirdperson help
« Reply #5 on: June 15, 2016, 02:34:26 PM »
All I wanna do is have that ulx thirdperson within a group category instead of uncategorized can you tell me how to do that? bytewave? or can I not ?
Again, don't register your command on the server only. That would be my best guess.
bw81@ulysses-forums ~ % whoami
Homepage

Offline C.Finley

  • Newbie
  • *
  • Posts: 36
  • Karma: 0
Re: ulx thirdperson help
« Reply #6 on: June 15, 2016, 02:34:56 PM »
im sorry but I am a noob and have no understand what that means. "don't register your command on the server only."
« Last Edit: June 15, 2016, 02:37:34 PM by C.Finley »

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given