Close player inventory and cancel looting
Discussion in 'Rust Development' started by Reynostrum, Jul 6, 2016.
-
If you are calling this as soon as a player opens something
NextTick(() =>
{
player.EndLooting();
});
Otherwise just player.EndLooting(); -
Where do you find stuff like that? I know where to find hooks and stuff.
-
Wulf Community Admin
NextTick is from Oxide, player.EndLooting is from the game's Assembly-CSharp.dll. -
Oh, so I would look through that?
-
Wulf Community Admin
For Rust stuff yes. You can use a .NET decompiler like JustDecompile, dotPeek, IL Spy, etc. -
Okay thanks.
Did someone make a list somewhere? I'd think there would be one by now. -
Wulf Community Admin
The list is in the DLL.
It'd take quite a bit of work to document the entire game. -
That is a good point, and as to what you said about random messages, somebody made a random number API I believe, I'm finding it to be very easily achievable.
-
Wulf Community Admin
The C# language has random functionality, you don't need an "API" for that. -
Indeed. I believe there is a betting plugin somewhere in oxide that could give you a example. Or searching the dev forum could work.
-
I'm so smart.
[DOUBLEPOST=1467780839][/DOUBLEPOST]I'm looking for it, is it for rust?
[DOUBLEPOST=1467781313][/DOUBLEPOST]Looked through all the plugins, didn't seem to be any. -
Check the development category. With the search term of random or something along those lines.
-
Pretty much nothing.
@Wulf, you were refering to
right?Code:Random random = new Random(); int randomNumber = random.Next(0, 10);
-
Wulf Community Admin
That's one way yes. -
Is there a better way you recommend?
-
Heres another way:Code:
UnityEngine.Random.Range(0, 10);
-
Thanks, that is a lot shorter.
-
Can't find anything,
That is the whole file.Code:using System.Reflection; using System.Runtime.CompilerServices; using System.Security.Permissions;[assembly: AssemblyVersion("0.0.0.0")] [assembly: PermissionSet(SecurityAction.RequestMinimum, XML="<PermissionSet class=\"System.Security.PermissionSet\"\nversion=\"1\">\n<IPermission class=\"System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\"\nversion=\"1\"\nFlags=\"SkipVerification\"/>\n</PermissionSet>\n")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows=true)] -
Make sure your deconping the Assembly.CSharp
