GetStoreLocation: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with ".")
 
m (Habi moved page GetStoreURL to GetStoreLocation without leaving a redirect)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
.
<poem style="border: 2px solid #d6d2c5; background-color: #f9f4e6; padding: 1em;">
This function was added in v1.8 beta 4  and will not work on previous versions.
</poem>
{{Welcome|desc=Gets the relative path where the store-files are downloaded|
params=<source>NoParams</source>|
retvals=The relative path of the hostname:port directory  (eg. "127.0.0.1-8192" )  in which store-files (script/main.nut, vehicles/carcols.xml) are downloaded if npc was connected with -d or -D switch. Otherwise, null is returned (store-files are not downloaded i.e. skipped )|
example=<source lang=lua>
function OnStoreDownloadComplete()
{
local path=GetStoreLocation();
if(path)
{
path+="script/main.nut";
print(path);
}
}
</source>
Output:
<source inline>C:/Users/UName/AppData/Roaming/VCMP/04beta/store/127.0.0.1-8192/script/main.nut</source>|
relfuncs=
*[[OnStoreDownloadComplete]]
*[[IsStoreDownloading]]
}}

Latest revision as of 00:41, 13 October 2024

This function was added in v1.8 beta 4 and will not work on previous versions.


Description:
Gets the relative path where the store-files are downloaded


Parameters:

NoParams


Return Values:
The relative path of the hostname:port directory (eg. "127.0.0.1-8192" ) in which store-files (script/main.nut, vehicles/carcols.xml) are downloaded if npc was connected with -d or -D switch. Otherwise, null is returned (store-files are not downloaded i.e. skipped )


Example

function OnStoreDownloadComplete()
{
	local path=GetStoreLocation();
	if(path)
	{
		path+="script/main.nut";
		
		print(path);
	}
}

Output: C:/Users/UName/AppData/Roaming/VCMP/04beta/store/127.0.0.1-8192/script/main.nut

Related Functions

The following functions may be helpful as they relate to this function in one way or another.