acp___(PL) Posted February 21, 2010 Share Posted February 21, 2010 <info name="Race" description="arc_'s MTA Race implementation" author="arc_" type="gamemode" version="0.8.3" build="r497 26Nov09" edf:definition="edf/race.edf"/> Problem is the lack of collisions between objects from outside the resource race I have a script for the race with a trailer, if someone loses a trailer when entering the checkpoint explodes You can of course try to connect a car with a trailer, but with out collision is sometimes not possible when the trailer is set in a wall direction How to make objects that were added by the script collisions with other objects? In the film you can see what the problem: - collisions are only between cars - there is no collision between a trailer and a car player or the rival car - there is a problem when connecting a trailer to the car Link to comment
acp___(PL) Posted February 21, 2010 Author Share Posted February 21, 2010 I tried in this way: - Server-side Event is added after the creation trailer - Client-side turn collisions, but there is no collisions - collisions are only between the trailers of two players server side function atachTrailerToPlayerVehicle(the_source) (...) trailerList[the_source] = createVehicle(435, trailerX, trailerY, trailerZ, vehicleRX, vehicleRY, vehicleRZ) (...) attachTrailerToVehicle(vehicleList[the_source], trailerList[the_source]) setTimer(function() triggerClientEvent ( "onClientColOn", g_rot, the_source, trailerList[the_source] ) outputConsole("triggerClientEvent ( onClientColOn, g_rot )" ..getPlayerName(the_source)) end, 5000, 1) end addEventHandler ( "onPlayerSpawn", g_rot, function () timerList[source] = setTimer(atachTrailerToPlayerVehicle, 500, 120, source) outputConsole("addEventHandler ( onPlayerSpawn, g_rot,: " ..getPlayerName(source)) end ) client side addEvent ( "onClientColOn", true ) addEventHandler ( "onClientColOn", g_rot, function(the_source, the_trailer) if the_source == gMe then for i, veh in ipairs (getElementsByType("vehicle")) do setElementCollidableWith(the_trailer, veh, true) end else setElementCollidableWith(getPedOccupiedVehicle(gMe), the_trailer, true) end end) Link to comment
Prox69 Posted February 22, 2022 Share Posted February 22, 2022 (edited) get the vehicles then set the data in your script --to enable setElementData (vehicle, 'race.collideothers', 1 ,true) --to disabled -- setElementData (vehicle, 'race.collideothers', 0 ,true) Edited February 22, 2022 by Prox69 Link to comment
marcelluss Posted February 22, 2022 Share Posted February 22, 2022 create a colshape and track the contact of both colshapes 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