Jump to content

Problem with no collision (race version="0.8.3")


acp___(PL)

Recommended Posts

<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

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
  • 12 years later...

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