toptional Posted November 19, 2012 Share Posted November 19, 2012 Whats the function that fixes a vehicle/aircraft Forgot it lol Link to comment
uhm Posted November 19, 2012 Share Posted November 19, 2012 https://wiki.multitheftauto.com/wiki/SetElementHealth lol Check out the wiki, it mostly has answers to these kinds of questions Link to comment
myonlake Posted November 19, 2012 Share Posted November 19, 2012 fixVehicle And I prefer not increasing your forum post amount while you can check the functions list over at the Wiki Page. https://wiki.multitheftauto.com/wiki/Ser ... _Functions https://wiki.multitheftauto.com/wiki/Cli ... _Functions Link to comment
toptional Posted November 19, 2012 Author Share Posted November 19, 2012 fixVehicle And I prefer not increasing your forum post amount while you can check the functions list over at the Wiki Page. https://wiki.multitheftauto.com/wiki/Ser ... _Functions https://wiki.multitheftauto.com/wiki/Cli ... _Functions I couldnt find it on the wiki! lol And asking here is just much easier Link to comment
manve1 Posted November 19, 2012 Share Posted November 19, 2012 I had same problem robbster, so you should check other posts too ... Link to comment
toptional Posted November 20, 2012 Author Share Posted November 20, 2012 Guys... fixVehicle ( vehicle theVehicle ) theVehicle: The vehicle you wish to fix I dont want a specific Vehicle to be fixed, i want any vehicle that enters this marker to be fixed, how to i make it any vehicle instead of just 1 Remember its Cars/Planes and others Link to comment
myonlake Posted November 20, 2012 Share Posted November 20, 2012 Guys... fixVehicle ( vehicle theVehicle ) theVehicle: The vehicle you wish to fix I dont want a specific Vehicle to be fixed, i want any vehicle that enters this marker to be fixed, how to i make it any vehicle instead of just 1 Remember its Cars/Planes and others Eh... it fixes the vehicle you wish to fix. For example... Server-side addCommandHandler("fixme", function(player, cmd) local vehicle = getPedOccupiedVehicle(player) if vehicle then fixVehicle(vehicle) end end ) Or... Server-side addEventHandler("onMarkerHit", root, function(hitElement, matchingDimension) if getElementType(hitElement) == "vehicle" and matchingDimension then fixVehicle(hitElement) end end ) Link to comment
toptional Posted November 20, 2012 Author Share Posted November 20, 2012 Guys... fixVehicle ( vehicle theVehicle ) theVehicle: The vehicle you wish to fix I dont want a specific Vehicle to be fixed, i want any vehicle that enters this marker to be fixed, how to i make it any vehicle instead of just 1 Remember its Cars/Planes and others Eh... it fixes the vehicle you wish to fix. For example... Server-side addCommandHandler("fixme", function(player, cmd) local vehicle = getPedOccupiedVehicle(player) if vehicle then fixVehicle(vehicle) end end ) Or... Server-side addEventHandler("onMarkerHit", root, function(hitElement, matchingDimension) if getElementType(hitElement) == "vehicle" and matchingDimension then fixVehicle(hitElement) end end ) Well i didnt need you to make me the script lol, Thanks anyway Link to comment
toptional Posted November 20, 2012 Author Share Posted November 20, 2012 Related to this topic, Whats wrong with this? airportLSMarker = createMarker ( 13.60000038147, -2390.8000488281, 1858.0999755859, "cyclinder" , 10, 255, 0, 0, 180) function airportMarkerHitLS ( hitPlayer, matchingDimension ) if getElementType(hitElement) == "vehicle" and matchingDimension then fixVehicle(hitElement) end end addEventHandler ( "onClientMarkerHit", airportLSMarker, airportMarkerHitLS ) Got this error WARNING : server.lua Bad Arguement at add eventhandler [Expected element at arguement 2, got bootlearn] Link to comment
TwiX! Posted November 20, 2012 Share Posted November 20, 2012 server.lua onClientMarkerHit Link to comment
myonlake Posted November 20, 2012 Share Posted November 20, 2012 Related to this topic, Whats wrong with this? airportLSMarker = createMarker ( 13.60000038147, -2390.8000488281, 1858.0999755859, "cyclinder" , 10, 255, 0, 0, 180) function airportMarkerHitLS ( hitPlayer, matchingDimension ) if getElementType(hitElement) == "vehicle" and matchingDimension then fixVehicle(hitElement) end end addEventHandler ( "onClientMarkerHit", airportLSMarker, airportMarkerHitLS ) Got this error WARNING : server.lua Bad Arguement at add eventhandler [Expected element at arguement 2, got bootlearn] server.luaonClientMarkerHit In other words, you are using a client-side event server-side, which is not possible. Link to comment
toptional Posted November 20, 2012 Author Share Posted November 20, 2012 (edited) Ofc! How could i forget So if i just changed that script into client.lua? It still wont work, what functions do i use? confused.com Edited November 20, 2012 by Guest Link to comment
TAPL Posted November 20, 2012 Share Posted November 20, 2012 function airportMarkerHitLS ( hitPlayer, matchingDimension ) fixVehicle(hitElement) Link to comment
toptional Posted November 20, 2012 Author Share Posted November 20, 2012 function airportMarkerHitLS ( hitPlayer, matchingDimension )fixVehicle(hitElement) Huh? It already is that... Client airportLSMarker = createMarker ( 13.60000038147, -2390.8000488281, 1858.0999755859, "cyclinder" , 10, 255, 0, 0, 180) function airportMarkerHitLS ( hitPlayer, matchingDimension ) if getElementType(hitElement) == "vehicle" and matchingDimension then fixVehicle(hitElement) end end addEventHandler ( "onClientMarkerHit", airportLSMarker, airportMarkerHitLS ) Link to comment
Castillo Posted November 20, 2012 Share Posted November 20, 2012 That's the problem, you are using 'hitElement', but your argument name is 'hitPlayer'. Link to comment
TAPL Posted November 20, 2012 Share Posted November 20, 2012 function airportMarkerHitLS ( hitPlayer, matchingDimension )fixVehicle(hitElement) Huh? It already is that... Nice joke. You are putting wrong argument. Can't you even see it? Also your script must be server side, because fixVehicle client side won't change anything for other players. Link to comment
Renkon Posted November 20, 2012 Share Posted November 20, 2012 As an scriptor let me make you understand that It would be better to do all this server-side. Secondly you are using (as TAPL said and you didn't understand due to your scriptor level) hitPlayer as argument when using hitElement.. 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