H5N1 Posted April 25, 2011 Share Posted April 25, 2011 (edited) Hello. Im making plugin to editor which will help with creating DD maps. But I have a problem. I dont know how editor's function 'doCreateElement' works. Arguments are really weird. When i use it my MTA crashes or no object is creating. Please explain this for me, how to use it. Edited April 27, 2011 by Guest Link to comment
eAi Posted April 26, 2011 Share Posted April 26, 2011 Have you read https://wiki.multitheftauto.com/wiki/Res ... or/Plugins ? Link to comment
H5N1 Posted April 26, 2011 Author Share Posted April 26, 2011 Yes, but can I use this function (doCreateElement) without import ()? Link to comment
Wojak Posted April 26, 2011 Share Posted April 26, 2011 function doCreateElement ( elementType, resourceName, creationParameters, attachLater, shortcut ) - elementType - the type of the element you want to create (for example "racepickup") - resourceName - the name of the resource the edf you want to use (for example "race") - creationParameters - table containing the element properties (for example creationParameters = {position = {0, 0, 0}, type="nitro"}) - i think it's optional - attachLater - idk... it can be true or false, i think it's optional - shortcut - idk, i think it's optional Link to comment
H5N1 Posted April 26, 2011 Author Share Posted April 26, 2011 I make this: exports.editor_main:doCreateElement("object", "toolbox", { model = obecneID, position = {objPoz[1], objPoz[2], objPoz[3]}}, false, nil) And my MTA crashes Roller coaster generator have this: triggerEvent("doCreateElement", gRootElement, "object", getResourceName(editor_main.resource), { model = 18450, position = position }, false, nil) Link to comment
FFS-Racing Posted April 26, 2011 Share Posted April 26, 2011 I could help you, but looking at the fact that you're just trying to rip off every functionality of something I've made, including the name, I won't. Link to comment
H5N1 Posted April 27, 2011 Author Share Posted April 27, 2011 I could help you, but looking at the fact that you're just trying to rip off every functionality of something I've made, including the name, I won't. Lol, H5N1's toolbox is work name, just like project natal for kinect and NGP for psp2 o0. Every functionality suggested my friends, not your resource. Link to comment
FFS-Racing Posted April 27, 2011 Share Posted April 27, 2011 I could help you, but looking at the fact that you're just trying to rip off every functionality of something I've made, including the name, I won't. Lol, H5N1's toolbox is work name, just like project natal for kinect and NGP for psp2 o0. Every functionality suggested my friends, not your resource. Yes, sure. Link to comment
H5N1 Posted April 27, 2011 Author Share Posted April 27, 2011 I just want help with this function. You dont have monopoly for toolboxes. I want make Open Source script for everyone, not like you for 'special' peoples. Link to comment
Mate_ Posted April 27, 2011 Share Posted April 27, 2011 FFS-Racing, maybe you can help me? I too want know how usage this fuctio but for private purposes. Link to comment
proracer Posted April 27, 2011 Share Posted April 27, 2011 You can use createObject if I'm not wrong..? Link to comment
Wojak Posted April 27, 2011 Share Posted April 27, 2011 You can use createObject if I'm not wrong..? why the hell he would try to use some weird exported funcion, if he just could use createObject? createObject will not create a entry in a map file, that could be saved in map editor... @H5N1 do your resource has an EDF file? or do you simply want to create a default obiect? try "editor_main" instead of "toolbox" Link to comment
H5N1 Posted April 27, 2011 Author Share Posted April 27, 2011 My resource dont have EDF. I will try it. Edit - it works! But how to set object rotation? When I make this exports.editor_main:doCreateElement("object", "editor_main", {model = obecneID, position = objPoz, rotation = objRot}, false, false) It doesnt work (no objects are creating). Edit - It works Thanks for help! Link to comment
H5N1 Posted May 3, 2011 Author Share Posted May 3, 2011 I have another problem. Objects which my script creates dont save with cords. <map edf:definitions="editor_main"> <object id="object (plasticsgate1) (1)" doublesided="false" model="7657" interior="0" dimension="0" posX="3233.4709472656" posY="-1599.8585205078" posZ="6.6665945053101" rotX="270" rotY="0" rotZ="0" /> <object id="object (plasticsgate1) (2)" doublesided="false" model="7657" interior="0" dimension="0" /> <object id="object (plasticsgate1) (3)" doublesided="false" model="7657" interior="0" dimension="0" /> <object id="object (plasticsgate1) (4)" doublesided="false" model="7657" interior="0" dimension="0" /> I must click on the object, then object which i clicked will be save with cords. I dont know how to fix this because doCreateElement doesnt return object info (userdata:xxxx). Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now