1. cookyman

    cookyman Naked Wanderer

    Hello,
    I'm new on this site and am just beginning to work with oxides.
    I would like a 7 days to the script create on the basis of javascript.

    but for the following two codes he always adds a :)) to the end of the line in the chat and server survey.

    Code (Text):
        OnPlayerConnected: function(player) {
            sdtd.BroadcastChat("[00FF00]" + player.playerName + " hat sich verbunden");
        },
    Code (Text):
    OnPlayerConnected: function(client) {
        sdtd.BroadcastChat(client.playerName + " has joined the server");
    }
    I have a question, there are to send a PM to a player a chance?

    Thank you in advance

    PS:
    Excuse me for my english,
    I'm from Germany and not just good in English
    --- Double Post Merged, Aug 30, 2016 ---
    Sorry, the smiley is wrong,
    it is a : be error for because
     
  2. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    What is the actual error you are getting?
     
  3. cookyman

    cookyman Naked Wanderer

    I have no error in the log or on the server,
    at the end of the chat line, he adds : automatically
     
  4. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Could I see the full file please?
     
  5. cookyman

    cookyman Naked Wanderer

    This is a small test script,

    Code (Text):
    var test = {
        Title: "test script",
        Version: V(0, 1, 0),
        Description: "mein erster test",
        Author: "cookyman",
        //HasConfig: true,

        OnPlayerConnected: function(player) {
            sdtd.BroadcastChat("[00FF00]" + player.playerName + " hat sich verbunden");
        }
        // LoadDefaultConfig : function () {
            // print("JavaScript: LoadDefaultConfig is working!");
            // this.Config.AuthLevel = 2;
            // this.Config.Data = ["blubb1", "blubb2"];
            // this.Config.Extra = { "oink" : "moep" };
        // }
    }
    I have also tried this:


    Code (Text):
        OnPlayerConnected: function(player) {
            sdtd.BroadcastChat("[00FF00]" + player.playerName + " hat sich verbunden", null);
        }
    Unfortunately, this always colon : at the end of the line.

    I've added them 2 pictures where they see what I mean.
     
  6. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    sdtd.BroadcastChat uses the name as the 1st argument and the message as the 2nd.
    Code (Text):
    sdtd.BroadcastChat("[00FF00]" + player.playerName, "hat sich verbunden");
     
  7. OpenFunRus

    OpenFunRus Wood Hoarder Plugin Developer

    Use:
    Code (Text):
    PrintToChat(string.Format("[00FF00] {0} {1} [FFFFFF]", player.playerName, "hat sich verbunden"));
     
  8. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    That's for C#, JavaScript can't handle that.
     
  9. cookyman

    cookyman Naked Wanderer

    Thanks for the great support