1. RaptikCZ

    RaptikCZ Naked Wanderer

    Hi,
    I am just playing with oxide, but cant get this working:

    Code (Text):

          void OnPlayerConnected(ClientInfo _client)
          {
            Puts($"OXIDE > " + _client.playerName + " se pripojil");
          }
     
    still got this error:

    Code (Text):

    21:53 [Info] JailPlugin was compiled successfully in 293ms
    21:53 [Info] Unloaded plugin JailPlugin v0.1.0 by Raptik
    21:53 [Info] Loaded plugin JailPlugin v0.1.0 by Raptik
    21:53 [Info] [JailPlugin] Jail Loaded
    21:54 [Error] Failed to call hook 'OnPlayerConnected' on plugin 'JailPlugin v0.1.0' (InvalidCastException: Cannot cast from source type to destination type.)
    21:54 [Debug]   at Oxide.Plugins.JailPlugin.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
     
    tried like in documentation and with lua... same type of error.
    dll have string declaration with ClientInfo.playerName
    i am new in c# but puts using string and declaration is string too, where is problem??? :)
     
  2. Wulf

    Wulf Community Admin Community Admin Oxide Developer

  3. RaptikCZ

    RaptikCZ Naked Wanderer

    OK, but this from oxide api for 7dtd:
    Code (Text):
    void OnPlayerConnected(ClientInfo client)
    {
        PrintToChat($"{client.playerName} has joined the server");
    }
    leads exactly to same error. (i hope that this example is correct)

    when i use

    EntityPlayer player and player.entityName -> error about EntityAlive have private entityName
     
  4. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    It may be wrong, I'll have to check and see. It's a bit behind in updates.
     
  5. RaptikCZ

    RaptikCZ Naked Wanderer

    Oki, thanks
    --- Double Post Merged, May 18, 2016, Original Post Date: May 16, 2016 ---
    hi, any progress???
    --- Double Post Merged, May 18, 2016 ---
    I am tried javascript
    Code (Text):
        OnPlayerConnected : function(client) {
            print("JavaScript: OnPlayerConnected is working!");
            print(client.playerName + " has connected!");
      //      sevendays.BroadcastChat(client.playerName + " has connected!", null);
        },
    and got this:

    Code (Text):
    22:02 [Info] JavaScript: OnPlayerConnected is working!
    22:02 [Info] undefined has connected!
     
  6. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Yeah, looking at the hooks it seems I may need to review them again to make sure everything is actually available. I think it may have been at one time, but it might have changed. I'll try to get to this later today time willing.
     
  7. RaptikCZ

    RaptikCZ Naked Wanderer

    OKi, sry for late answer.

    openfunrus have solution for this in one of his threads :) but tutorial don't mention it.

    now i looking for a way how to detect attacker (if it is player or zombie) - i will create thread for it after i have more things to ask and more problems unsolved - now i know only that EntityAlive have entityType for using for it and OnEntityTakeDamage seems to be triggered only with damage from zeds (if player hit me no info to log; zed hit me and it is loged )
     
  8. OpenFunRus

    OpenFunRus Wood Hoarder Plugin Developer

    Yes. Previously in alpha 13, in game chat we was see message "player eliminated player", but now message not show...
     
  9. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    The Docs are updated as the support for a game developers, the solution is not something that should be needed, the hooks just need to be overhauled.