Zadara Posted April 27, 2009 Share Posted April 27, 2009 Hi there, I am busy with a little script, but i got one problem, i wanna use a marker to attach a vehicle to a vehicle, i wanna have a callback that is that the vehicle the source is, so i go search on MTA wiki if there is a callback function for: onVehicleMarkerHit, but there is'nt, only onMarkerHit, and OnPlayerMarkerhit. How i can script this so simple has possible? function enterVehicle ( player, seat, jacked ) if ( getVehicleID ( source ) == 476 ) then outputChatBox ("You are enter a Ruslter!.") local x, y, z = getElementPosition( source ) local rcbaron = createVehicle ( 464, x, y, z - 2 ) attachElementToElement( rcbaron, source, 0, 0, -2 ) end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) Thanks, Link to comment
Gamesnert Posted April 27, 2009 Share Posted April 27, 2009 onMarkerHit. It works with any element. Read the page. Link to comment
Zadara Posted April 28, 2009 Author Share Posted April 28, 2009 onMarkerHit. It works with any element. Read the page. The problem is that by the onMarkerHit, the source the maker, but i don't want that the source the marker is, but that the source the vehicle is. How can i solv this? Link to comment
norby89 Posted April 28, 2009 Share Posted April 28, 2009 onMarkerHit. It works with any element. Read the page. The problem is that by the onMarkerHit, the source the maker, but i don't want that the source the marker is, but that the source the vehicle is. How can i solv this? you've got the player that hit the marker, just check if he's in a vehicle and that he is driving it Link to comment
robhol Posted April 28, 2009 Share Posted April 28, 2009 I'm not sure whether or not it's actually accurate, but according to its wiki page, onMarkerHit does NOT work with generic elements, only with players. I recommend that you create a collision shape (colshape) that you hook up to events, and keep the marker only for "decoration". Link to comment
Zadara Posted April 28, 2009 Author Share Posted April 28, 2009 Thanks, one question: onVehicleRespawn, when a vehicle spawn just on the beginning, can i use the event also? So when i start the gamemode, the vehicle spawn, can i use then onVehicleRespawn, for that to set something for the veicle? I don't see a OnVehicleSpawn, so i think this is possible... I can't try, my pc is a little bit broken,,, Link to comment
Zadara Posted April 28, 2009 Author Share Posted April 28, 2009 Ok, forgot everything what i have say, i have now two questions. Question 1:How can i attach something when its spawn, not respawn, just spawn when the gamemode start. There is a onVehicleRespawn, but not a onVehicleSpawn... That says wiki... Question 2: When i attach a little rc vehicle to a normal plane, and i make a sharp bend with the normal airplane, the rc vehicle just let loose. It's not attach anymore on the plane. Is this a bug or something? And is there a way to reslove this? Link to comment
Synieztro Posted December 7, 2019 Share Posted December 7, 2019 On 28/4/2009 at 7:46, norby89 said: tienes al jugador que golpeó el marcador, solo verifica si está en un vehículo y si lo está conduciendo Cuales serian esos eventos? 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