squar Posted February 10, 2013 Posted February 10, 2013 function createWorldObject ( thePlayer,objectID,objectPosX,objectPosY,objectPosZ) local rx,ry,rz = getElementRotation ( source ) obj = createObject(thePlayer,objectID,objectPosX,objectPosY,objectPosZ) setElementRotation(obj,rx,ry,rz) end addEvent("createObject",true) addEventHandler("createObject",root,createWorldObject) function removeLastObject () destroyElement(obj) end addEvent("onRemoveLast",true) addEventHandler("onRemoveLast",root,removeLastObject) function removeAllObjects () destroyElement () end addEvent("onRemoveAll",true) addEventHandler("onRemoveAll",root,removeAllObjects) I'm not sure how I can make a remove All objects function. I was trying to remove all objects I have PLACED. It seemed to be a little bit complicated, and was wondering if any of you could have a look on it, and probably give a little hint about what to do. This is server side, obviously...
PaiN^ Posted February 10, 2013 Posted February 10, 2013 I don't know how to make that kind of script, But ican tell that you'res is wrong !! " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
csiguusz Posted February 10, 2013 Posted February 10, 2013 You can insert your objects into a table, then to delete them all loop through that table, and delete the objects. Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003
MR.S3D Posted February 10, 2013 Posted February 10, 2013 function createWorldObject ( thePlayer,objectID,objectPosX,objectPosY,objectPosZ) local rx,ry,rz = getElementRotation ( source ) obj = createObject(thePlayer,objectID,objectPosX,objectPosY,objectPosZ) setElementRotation(obj,rx,ry,rz) end addEvent("createObject",true) addEventHandler("createObject",root,createWorldObject) function removeLastObject () destroyElement(obj) end addEvent("onRemoveLast",true) addEventHandler("onRemoveLast",root,removeLastObject) function removeAllObjects () for k,v in ipairs(getElementsByType ( "object", getResourceRootElement(getThisResource()))) do destroyElement (v) end end addEvent("onRemoveAll",true) addEventHandler("onRemoveAll",root,removeAllObjects) Welcom to my server Q.5 Current game type in my server Drift my Email : [email protected] Programming level: 90%
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