Jump to content

Invisible Objects


BabY

Recommended Posts

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 :D

[DMC]MI550 ;)

Link to comment

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 :P

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

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 :D createObject

-----------------------------------------------------------------------------------------------------------------------------------------------

And your first code,

tell me how were u going to get the location and id of the object you want? :roll:

Link to comment

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
  • Discord Moderators

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 by Guest
Link to comment
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...