Mds.name Shared function

From Gothic 2 Online: Wiki
Jump to navigation Jump to search

This function was added in version: 0.0.0.0

Function gets mds file name by it's id. Mds must be registered in mds.xml file, in order to be able to, for example: apply overlay for specifc player.

NOTE! After server restart, every mds does have different id. The id is the same on both sides.

Syntax

string or null Mds.name(int id)

Required Arguments

  • id: The mds id.

Returns

  • string or null: string when mds id if the files is registered in mds.xml, otherwise null.

Example

addEventHandler("onInit",function(pid)
{
    local mdsId = Mds.id("HUMANS_1HST1.MDS"))
    local mdsName = Mds.name(mdsId) // dummy example
    print(mdsName); // it will print "HUMANS_1HST1.MDS"
};

Related functions