1. Hi, what is a method for detect a player use c4 or grnade ?

    Its for limit the use c4 (ex : 10c4 use in 5sec)
     
  2. Wulf

    Wulf Community Admin

    You can hook into the OnExplosiveThrown hook, which should cover that I think.
     
  3. Thanks but im new in a coding lua plugin for oxide :s where i find a complet doc for the method OnExplosiveThrown ?
     
  4. Thanks but i know this website :s

    With lua code :

    Code:
    function PLUGIN:OnExplosiveThrown(player, entity)
        print("plugin test".."name :"..name.."entity :"..entity)
    end
    I have error :

    Code:
    [Oxide] 14:45 [Error] Failed to call hook 'OnExplosiveThrown' on plugin 'test v0.0.1'
    File: test.lua Line: 17 attempt to concatenate local 'entity' (a userdata value):
      at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0
      at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0
      at NLua.Lua.CallFunction (System.Object function, System.Object[] args) [0x00000] in <filename unknown>:0
      at NLua.LuaFunction.Call (System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Ext.Lua.Plugins.LuaPlugin.OnCallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
    
     
  5. Wulf

    Wulf Community Admin

    You wouldn't be able to print the entire entity, you'd have to transverse it a bit to get something you can.
     
  6. But im new :s its possible of you help me ?
     
  7. Wulf

    Wulf Community Admin

    Do you want someone to write it for you or do you want to learn how to do it? ;)

    entity.name, entity.OwnerID, entity.PrefabName, etc.
     
  8. Thanks, i need to learn all in the lua code for oxide because i started sunday when i sended my first post :)

    Where i find all method "entity.name, entity.OwnerID, entity.PrefabName, etc. " ?
     
  9. Wulf

    Wulf Community Admin

    All of that is located in Rust itself, which you can find using a decompiler such as JustDecompiler and Rust's Assembly-CSharp.dll.
     
  10. Thanks, im download now the JustDecompiler ^^
    [DOUBLEPOST=1473860661][/DOUBLEPOST]In the Assembly-CSharp.dll i don't find the list with "entity.name, entity.OwnerID, entity.PrefabName, etc."

    what is the path tree ?
     
  11. How to cancel the launch explosif in "OnExplosiveThrown" ?
     
  12. Wulf

    Wulf Community Admin

    You'd have to use Rust methods to kill/destroy/remove the entity.
     
  13. this would for example stop the Explode:

    Code:
    void OnExplosiveThrown(BasePlayer player, BaseEntity entity)
    {
        if (entity != null && entity is TimedExplosive)
        {
            entity.CancelInvoke("Explode");
        }
    }
     
  14. Thanks :)
     
    Last edited by a moderator: Sep 22, 2016
  15. :) :) :) :) :)
     
    Last edited by a moderator: Sep 23, 2016