User:Erorr404/My Resources/Safehouse Documentation

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This resource allows players to buy, sell, and use properties in much the same way as they can in single player. Properties are associated with account names, which are to be specified and managed by an outside resource. These associations are stored in databases managed by this resource.

The characteristics of a property (it's location, interior, garage area, save marker, etc.) are stored in an XML file whose root node is passed to the loadPropertiesFromFile function. It has the following form:

<root>
	<property id="vegas suburbs house 1" x="1282.1369628906" y="2522.3305664063" z="10.8203125" r="270" price="320000">
		<camera x="1298.2105712891" y="2530.1906738281" z="16.638565063477" lax="1297.2188720703" lay="2530.1906738281" laz="16.510410308838" />
		<interior heaven="9" dimension="1024"/>
		<entrance x="1273.953125" y="2522.4836425781" z="11.8203125"/>
		<entrance_target x="2317.82" y="-1024.75" z="1050.2177734375" r="0"/>
		<exit x="2317.82" y="-1026.75" z="1051.2177734375"/>
		<exit_target x="1276.47265625" y="2522.4951171875" z="10.8203125" r="270"/>
		<save_marker x="2320.5356445313" y="-1008.3101196289" z="1050.2109375" r="0" />
		<parking_area x="1269.6076660156" y="2525.603515625" z="9.8203125" width="10" depth="9" height="5"/>
		<garage_door id="38" x="1279.1956787109" y="2525.5373535156" z="9.8203125" width="6" depth="8" height="5"/>
	</property>
etc.

where the entrance is the location of the entrance marker and the entrance target is the location the player is warped to upon hitting the marker. The exit locations are described similarly. The parking area and garage represent optional locations where vehicles can be parked to be saved.

bool loadPropertiesFromFile ( fileRoot, [table loggedInPlayers = {}] )
bool unloadCurrentProperties ()
bool loginPlayerAccount ( string accountName, player thePlayer )
bool logoutPlayerAccount ( string accountName )

table getPlayerProperties ( string accountName )
string getPlayerLastSavedProperty ( string accountName )
bool loadPlayerGameAtProperty ( string accountName, string propertyID )
bool loadVehiclesAtPlayerProperties ( string accountName )
bool unloadVehiclesAtPlayerProperties ( string accountName )
nil deletePlayerProperties ( string accountName )
nil deletePlayerProperty ( string accountName, string propertyID )