1. The args parameter in your function is a userdata that contains of everything written after the initial command.
    So if someone writes "/cmd hello world this is domestos" the command is /cmd and args contains "hello world this is domestos" where every word is a different element is the userdata.
    So the first element is args[0] which would be "hello", the second element is args[1] which would be "world" and so on.
    And because in c# the index is starting with 0 and not 1 the total number of elements is length - 1.
     
  2. kk
    [DOUBLEPOST=1427658673,1427643756][/DOUBLEPOST]I think I just got it right, but well it seems like I dont.
    There is the problem that whatever I am writing im always getting the Syntax Error.
    I tried it with an example of message sending with a custom prefix and message.
    Code:
    function PLUGIN:cmdMessage(player, cmd, args)
        if args.Lenght == -1 then -- or do I need "if args.Lenght == 1 then"? idk... I think my error is here...
            local Prefix = tostring(args[0])
            local Message = tostring(args[1])
            if player.net.connection.authLevel < self.Config.Authlevel then
                rust.SendChatMessage(player, "Messages", self.Config.NoPermission)
            else
                rust.BroadcastChat(Prefix, Message)
            end
        else
            rust.SendChatMessage(player, "Messages", "Syntax: /msg [Prefix] [Message]")       
        end
    end
    
    I don't want a working code because its not helping me really. just as Hatemail said too.
    Just wanna know what I didn't understand yet...
     
  3. it's LengTH and in your case you need 2 arguments so you need to compare it against 2 so
    if args.Length == 2 then
    ................................ rest of your code
     
  4. Your mistake is in the line you think it is.
    What do you wanna check to get into the if?
     
  5. well I didn't see that I failed at typing ^^
    Ok now I think im sure with this case of args using...
    Thanks again and sorry for my many questions :v