Author Topic: Some problems with my return script *please help*  (Read 2383 times)

0 Members and 2 Guests are viewing this topic.

Offline mrbell11

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Some problems with my return script *please help*
« on: December 31, 2014, 11:16:32 AM »
Hello everyone,
I have attempted to make a return script for my DarkRP server but it seems to not work if someone could please help me that would be very helpful
Thank you.


*SCRIPT*
local CATEGORY_NAME = "mrbell11's Return Script"

function ulx.return( calling_ply, target_ply )
   if not calling_ply:IsValid() then
      Msg( "Sorry This is not Valid #A.\n" )
      return
   end
   if not target_ply:Alive() then
      ULib.tsayError( calling_ply, target_ply:Nick() .. " is dead!", true )
      return
   end
   local newpos = LastPos[ target_ply:SteamID() ]
   if not newpos then
      ULib.tsayError( calling_ply, "Can't find a place to return this Player.", true )
      return
   end
   target_ply:SetPos( LastPos[ target_ply:SteamID() ] )
   target_ply:SetLocalVelocity( Vector( 0, 0, 0 ) )
   ulx.fancyLogAdmin( calling_ply, "#A returned #T", target_ply )
end
local return = ulx.command( CATEGORY_NAME, "mrbell11's Return Script", ulx.return,
"!return", true )
return:addParam{ type = ULib.cmds.PlayerArg, ULib.cmds.optional }
return:defaultAccess( ULib.ACCESS_ADMIN )
return:help( "Returns a player to previous location." )

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Some problems with my return script *please help*
« Reply #1 on: December 31, 2014, 03:10:27 PM »
Are you not using ULX? ULX already has a ulx.return function.
If you're not using ULX, trying to use that code will not work, as it's written using variables and command structure only intended for ULX.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline mrbell11

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Some problems with my return script *please help*
« Reply #2 on: December 31, 2014, 03:16:41 PM »
Their isn't a return command with the one that I have

Did they just add this

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Some problems with my return script *please help*
« Reply #3 on: December 31, 2014, 04:11:33 PM »
No.
We added it August 30th 2013.
https://github.com/Nayruden/Ulysses/commit/59910af7893bb26fcff127302bfc16de8c1161d2
We added it hours after our last official release.
If your using our release code, I'd strongly suggest getting our Github zip from https://github.com/Nayruden/Ulysses/ and extracting/using ULib and ULX folders from it.
Not only does it contain "ulx return" (!return), it contains many fixes for what Garry broke over many updates of the past year and a half.
(and, some stuff we needed to fix too)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline mrbell11

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Some problems with my return script *please help*
« Reply #4 on: December 31, 2014, 08:57:05 PM »
Hey cool and very much thanks for the code I needed it for my DarkRP Server. Also I was wondering was the code that I made suitable like what level would you put it as.
Beginner middle or hardcore. probably not hardcore

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: Some problems with my return script *please help*
« Reply #5 on: January 26, 2015, 03:22:02 PM »
So will that code above work? i have been looking for a return command like this!!!

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Some problems with my return script *please help*
« Reply #6 on: January 26, 2015, 03:34:54 PM »
So will that code above work? i have been looking for a return command like this!!!

No. His code doesn't work. No new code was offered, because ULX already has 'ulx return'
Please read a discussion before posting, thanks. Saves time for everyone.

strongly suggest getting our Github zip from https://github.com/Nayruden/Ulysses/ and extracting/using ULib and ULX folders from it.
Not only does it contain "ulx return" (!return), it contains many fixes for what Garry broke over many updates of the past year and a half.
(and, some stuff we needed to fix too)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming