Set max players in lobby, localization and invalid using GetPlayerName()

edited July 2015 in Questions

(1). How to set max count of players in lobby? I have 2 team of 4 slots (8 players), but also can join somebody 9th and 10th. I change string in addoninfo.txt:

"MaxPlayers"        "8"

but problem still exists.

(2). Can I somehow know in Lua which language using player in Dota?

(3). My file addon_russian.txt works earlier, but in some moment something broken and from it takes only addon_name. His coding is UTF-16 LE with BOM, encoded with Sublime Text 3. What can be other causes?

(4). How to use GetPlayerName()? If i put on it integer value (e.g. 0 or 1), console print error:

attempt to call global 'GetPlayerName' (a nil value)

Ofc it happening if I put needed me caster:GetPlayerOwnerID() I try these writing:

GetPlayerName(caster:GetPlayerOwnerID())
GameRules:GetPlayerName(caster:GetPlayerOwnerID())
caster:GetPlayerOwnerID():GetPlayerName() --lolwut

but none of them is correct.

Description, lol

Comments

  • I can't format thread, why forum change my numeration? :D

    Description, lol

  • edited July 2015 Posts: 1,670

    Markdown forgets your numbers, just use 1) 2) 3) with breaklines in between

    1) Max players are per map.

    2) I don't think so, why would you need that? Use Panorama instead

    4) GetPlayerName is nil on Tools, steam names are only visible in the main client

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • edited July 2015 Posts: 33

    (1). Ty, done .

    (2). To localize inscriptions.

    (4). Can I know it somehow other?

    Description, lol

  • Posts: 1,670

    (4). Can I know it somehow other?

    Upload a private version of your mod to the workshop and test there.

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||

  • GetPlayerName is nil on Tools, steam names are only visible in the main client

    It doesn't work even in main client, how to use it?

    Description, lol

  • Posts: 1,670

    It's on the wiki, Global accessor variable: PlayerResource so PlayerResource:GetPlayerName(playerID)

    The concept of Modding Community doesn't go well together with Competitive Business
    My Project Page || My GitHub Profile ||