yMassai Posted December 31, 2012 Share Posted December 31, 2012 can anyone help me? i want that when my vehicle hit on the water within a minute he appears in the parking lot. the parking i will determine the coordinates x, y, z. Link to comment
Anderl Posted December 31, 2012 Share Posted December 31, 2012 isElementInWater setTimer setElementPosition Link to comment
yMassai Posted January 2, 2013 Author Share Posted January 2, 2013 function resurgeveiculo () if isElementInWater(vehicletrafic[source]) then setTimer( setElementPosition ( vehicletrafic[source] , 1650.54077, -1626.85131, 24.89843 ) , 10000, 1, source, true,1 ) end end addEventHandler("onClientResourceStart", root, resurgeveiculo) Link to comment
Blaawee Posted January 2, 2013 Share Posted January 2, 2013 read the 'setTimer' arguments https://wiki.multitheftauto.com/wiki/SetTimer i think it should be like this : function resurgeveiculo () if isElementInWater(vehicletrafic[source]) then setTimer( setElementPosition, 10000, 1, vehicletrafic[source] , 1650.54077, -1626.85131, 24.89843 ) end end addEventHandler("onClientResourceStart", root, resurgeveiculo) Link to comment
Baseplate Posted January 2, 2013 Share Posted January 2, 2013 addEventHandler("onClientResourceStart", resourceRoot, resurgeveiculo) Link to comment
abu5lf Posted January 2, 2013 Share Posted January 2, 2013 setTimer( function( ) for _, aVehicle in next, getElementsByType 'vehicle' do if isElementInWater( aVehicle ) then setElementPosition( aVehicle, 1650.54077, -1626.85131, 24.89843 ) end end end, 5000, 0 ) Link to comment
TAPL Posted January 2, 2013 Share Posted January 2, 2013 Well, what about if you have like 20 vehicles, all of them will be in same coordinates? Link to comment
DNL291 Posted January 3, 2013 Share Posted January 3, 2013 function resurgeveiculo () if isElementInWater(vehicletrafic[source]) then setTimer( setElementPosition, 1000, 1, vehicletrafic[source], 1650.54077, -1626.85131, 24.89843 ) end end setTimer( resurgeveiculo, 400, 0 ) Link to comment
yMassai Posted January 3, 2013 Author Share Posted January 3, 2013 to DNL bad argument @ 'isElementInWater' [expected element at argument 1, got nil] tapl, the intention is to only remove the water vehicle Link to comment
Callum Posted January 3, 2013 Share Posted January 3, 2013 You can use onClientVehicleDrown. 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