Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- First of all you'll need to put your custom objects (DFF, TXD and COL) into MTA San Andreas 1.1\server\mods\deathmatch\resources\[editor]\editor_main\.
- Then open MTA San Andreas 1.1\server\mods\deathmatch\resources\[editor]\editor_main\meta.xml and add these like the other objects:
- [code]
- <file src="yourobject.dff" />
- <file src="yourobject.col" />
- <file src="yourobject.txd" />
- [/code]
- After that, open samp_models_lsoffice.lua in the same folder (or create a new file if you want).
- Add this like the other objects:
- [code]
- txd1000 = engineLoadTXD('yourobject.txd')
- engineImportTXD(txd1000, the_replaced_object_model_id)
- col1000 = engineLoadCOL('yourobject.col')
- dff1000 = engineLoadDFF('yourobject.dff', 0)
- engineReplaceCOL(txd1000, the_replaced_object_model_id)
- engineReplaceModel(txd1000, the_replaced_object_model_id)
- engineReplaceCOL(txd1000, the_replaced_object_model_id)
- [/code]
- If you create a new script instead of editing samp_models_lsoffice.lua, you'll need to do this:
- [code]
- rootElement = getRootElement()
- function loadobj(resource)
- if resource ~= getThisResource() then return end
- txd1000 = engineLoadTXD('yourobject.txd')
- engineImportTXD(txd1000, the_replaced_object_id)
- col1000 = engineLoadCOL('yourobject.col')
- dff1000 = engineLoadDFF('yourobject.dff', 0)
- engineReplaceCOL(txd1000, the_replaced_object_id)
- engineReplaceModel(txd1000, the_replaced_object_id)
- engineReplaceCOL(txd1000, the_replaced_object_id)
- end
- addEventHandler('onClientResourceStart', rootElement, loadobj)
- [/code]
- and then go back to MTA San Andreas 1.1\server\mods\deathmatch\resources\[editor]\editor_main\meta.xml and add/uncomment the script so that it can be loaded in map editor:
- [code]
- <!--SA-MP Objects -->
- <script src="samp_models_lsoffice.lua" type="client"/>
- <script src="your_own_script_name_if_you_create_a_new_one.lua" type="client"/>
- <!--<script src="samp_models_rc3_1.lua" type="client"/>-->
- <!--<script src="samp_models_rc3_2.lua" type="client"/>-->
- <!--<script src="samp_models_rc4.lua" type="client"/>-->
- <!--<script src="samp_models_rc5.lua" type="client"/>-->
- [/code]
- Then open MTA San Andreas 1.1\server\mods\deathmatch\resources\[editor]\editor_gui\client\browser\objects.xml
- and add a new category, or append to the old categories if you want to:
- [code]
- <group name="Custom objects">
- <object model="the_replaced_object_model_id" name="Your first custom object in MTA:SA" keywords=""/>
- </group>
- <group name="Enterable LS Building">
- <object model="4587" name="LSOffice1" keywords=""/>
- <object model="3781" name="LSOffice1Floors" keywords=""/>
- <object model="4605" name="LSOffice1Glass" keywords=""/>
- </group>
- [/code]
- Done. Note that I use MTA:SA 1.1 as example. If you use 1.0.5, the path will be a little bit different, but I think it is not hard to find the folder of the map editor.
Advertisement
Add Comment
Please, Sign In to add comment