BabY Posted October 20, 2010 Share Posted October 20, 2010 Hi all Guys, Plesae Listen Carefully ... When I Tried to add Collision Object in my Map ... I Found a Problem ... the Object isn't Collisioned ... It's Regular and Hit Able ... and I Made the "client.lua" File ... Take a Look : function startclient () setElementCollisionsEnabled (vgncarshade1 (81), true) end addEventHandler( "onClientResourceStart", resourceRoot, startclient ) I Realy Don't know what is the Problem in my File .. Plesae Help me Fast [DMC]MI550 Link to comment
dzek (varez) Posted October 20, 2010 Share Posted October 20, 2010 you can't do it this way. this is totally wrong "vgncarshade1 (81)" is invalid reference to object, it's not even string true means rather enabled than disabled and im not sure if resourceRoot is hardcoded value also explain exactly what you need to do? disable collisions on all objects of one type? or just disable on one specific object from map? if 2nd: addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), function() setElementCollisionsEnabled (getElementByID("vgncarshade1 (81)"), true) end) Link to comment
BabY Posted October 21, 2010 Author Share Posted October 21, 2010 This Object only, "no. 81" btw :-/ It is ... NOT WORKING . But, May I Ask a Qustion ? I Have a Bug when I Test my map i RACE mod ... This Effect in Some scripts I Attached to the Map ? and Thank you. MI550 Link to comment
dzek (varez) Posted October 21, 2010 Share Posted October 21, 2010 explain EXACTLY what do you want to achieve And explain EXACTLY what bug are you getting. I can't understand you with your english.. Link to comment
BabY Posted October 21, 2010 Author Share Posted October 21, 2010 Look I Want to Make an Object in my RACE map to be Visible BUT ! I Can't Hit it ... so ... Help me :-[ Link to comment
[DMC] Posted October 21, 2010 Share Posted October 21, 2010 Client-Side addEventHandler('onClientResourceStart', resourceRoot, function () Object1 = createObject ( objectID, x, y, z, 0, 0, 0 ) setElementCollisionsEnabled (Object1, false) end ) if im not wrong this should work and if you want a vgncarshade it will be Object1 = createObject ( 3458, x, y, z, 0, 0, 0 ) at object1: you put the coordinates at x, y, z ( in the map you dont add the object, the script will make it createObject ----------------------------------------------------------------------------------------------------------------------------------------------- And your first code, tell me how were u going to get the location and id of the object you want? Link to comment
BabY Posted October 21, 2010 Author Share Posted October 21, 2010 (edited) lol Iam tring it ... Edited October 21, 2010 by Guest Link to comment
BabY Posted October 21, 2010 Author Share Posted October 21, 2010 Not Working ^^ This Look at my FUCKIN Script File ... addEventHandler('onClientResourceStart', resourceRoot, function () Object1 = createObject ( 13647, 4170.9091796875, -446.18707275391, 2.7261011600494, 0, 180, 261.99096679688 ) setElementCollisionsEnabled (Object1, false) end ) I HATE MY SELF . What I Made : * Put the Line in meta.xml * Made the Sript File * Fucked by my self ... Link to comment
dzek (varez) Posted October 21, 2010 Share Posted October 21, 2010 is it creating that object or not? because im not sure if resourceRoot is hardcoded variable, use getResourceRootElement(getThisResource()) instead. and if its creating element but it's collidable - then idk whats wrong, never played with setElementCollisionsEnabled Link to comment
Discord Moderators Zango Posted October 21, 2010 Discord Moderators Share Posted October 21, 2010 (edited) resourceRoot is hardcoded variable but - it takes a bit time for MTA to create object, so set a timer on like 100ms to apply the non colliding stuff Edited October 21, 2010 by Guest Link to comment
dzek (varez) Posted October 21, 2010 Share Posted October 21, 2010 thanks zango. MI550: dont go offtopic, also stop using bad words please. Link to comment
BabY Posted October 21, 2010 Author Share Posted October 21, 2010 thanks zango.MI550: dont go offtopic, also stop using bad words please. I'am Sorry ... resourceRoot is hardcoded variable but - it takes a bit time for MTA to create object, so set a timer on like 100ms to apply the non colliding stuff How to Make this ? lol Link to comment
Discord Moderators Zango Posted October 21, 2010 Discord Moderators Share Posted October 21, 2010 addEventHandler('onClientResourceStart', resourceRoot, function () Object1 = createObject ( 13647, 4170.9091796875, -446.18707275391, 2.7261011600494, 0, 180, 261.99096679688 ) setTimer ( function () setElementCollisionsEnabled (Object1, false) end, 400, 1 ) end ) Link to comment
BabY Posted October 21, 2010 Author Share Posted October 21, 2010 Thank you Very Much ! It's Working and Cool I Realy, REALY Don't know How to Thank you 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