Jump to content

onColShapeHit not working on a element


Recommended Posts

Hey,

I have been searching for about a week into this problem, and i still cant get it.

For some reason, onColShapeHit only works for a player when he is outside the vehicle (then i get the outPutChatBox message as check), but it should work on the vehicle (thecar) element only.

- the positions inside the table's are fine

- When i drive with the car into the shape, noting works, but when i exit the vehicle i do get the output in checkbox ( outputChatBox("garageid: " .. tostring(garages[garageid].id)) )

  
thecar = createVehicle(cars[carid].model, cars[carid].x,cars[carid].y, cars[carid].z, cars[carid].rx, cars[carid].ry, cars[carid].rz, cars[carid].plate) 
  
-- colshape front garage 
eventfrontgarageshape = createColCuboid(garages[garageid].x-5, garages[garageid].y-5, garages[garageid].z, 10, 10, 10) 
  
     
-- colshape inside garage 
eventinsidegarageshape = createColCuboid(garages[garageid].x_in-3, garages[garageid].y_in-3, garages[garageid].z_in, 6, 6, 6) 
  
  
--player reached garage 
    function playerreachedgarage(theelement) 
    -- something goes wrong here 
     
    outputChatBox("garageid: " .. tostring(garages[garageid].id)) 
  
        if (theelement == thecar ) then 
            if (getVehicleOccupant(thecar)) then 
            setGarageOpen(garages[garageid].id, true) 
            end 
        end 
    end 
  
addEventHandler("onColShapeHit", eventfrontgarageshape, playerreachedgarage) 
  

ive pasted the full serverside script on pastebin:

http://mta.pastebin.com/d780174de

i could also put the client and xml files with positions if its needed

I hope that anyone could notice whats wrong.

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...