Ulysses
General => Developers Corner => Topic started by: mrbell11 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." )
-
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.
-
Their isn't a return command with the one that I have
Did they just add this
-
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)
-
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
-
So will that code above work? i have been looking for a return command like this!!!
-
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)