Nutella Posted May 21, 2016 Share Posted May 21, 2016 (edited) So, ive got a marker, and the Idea is that a player in a car is going to drive in it, and then the server is going to ask the player to pay for a repair, I'll finish it, but here is what im standing on: local blip = createBlip ( 1953.40, 2162.52, 10.49 , 27 , 2 , 99999.0 ) local m1 = createMarker(1953.40, 2162.52, 10.49, "cylinder", 4.0, 255, 0, 0) function naprawa ( hitElement,playerSource, matchingDimension ) pojazd = getPedOccupiedVehicle(thePlayer) typ_elementu = getElementType(pojazd) stan_pojazdu = getElementHealth(pojazd)/10 if (isElementWithinMarker(thePlayer,m1)) then outputChatBox( "Automat naprawczy model HAIER-M3",kierowca, 255, 255, 0 ) if(pojazd ~= false) then outputChatBox( "Twoj pojazd ma "..stan_pojazdu.." punktów stanu pojazdu.") else outputChatBox( "Najpierw bądź w pojeździe!", thePlayer, 255, 50, 50 ) end end end addEventHandler( "onMarkerHit", m1, naprawa ) and the problem is, that the server gives: [2016-05-21 21:13:04] WARNING: naprawa/blip.lua:5: Bad argument @ 'getPedOccupiedVehicle' [Expected ped at argument 1, got vehicle] [2016-05-21 21:13:04] WARNING: naprawa/blip.lua:6: Bad argument @ 'getElementType' [Expected element at argument 1, got boolean] [2016-05-21 21:13:04] WARNING: naprawa/blip.lua:7: Bad argument @ 'getElementHealth' [Expected element at argument 1, got boolean] [2016-05-21 21:13:04] ERROR: naprawa/blip.lua:7: attempt to perform arithmetic on a boolean value Edited May 21, 2016 by Guest Link to comment
Dimos7 Posted May 21, 2016 Share Posted May 21, 2016 local blip = createBlip ( 1953.40, 2162.52, 10.49 , 27 , 2 , 99999.0 ) local m1 = createMarker(1953.40, 2162.52, 10.49, "cylinder", 4.0, 255, 0, 0) function naprawa ( hitElement,playerSource, matchingDimension ) pojazd = getPedOccupiedVehicle(playerSource) typ_elementu = getElementType(pojazd) stan_pojazdu = getElementHealth(pojazd)/10 if (isElementWithinMarker(playerSource,m1)) then outputChatBox( "Automat naprawczy model HAIER-M3",kierowca, 255, 255, 0 ) if(pojazd ~= false) then outputChatBox( "Twoj pojazd ma "..stan_pojazdu.." punktów stanu pojazdu.") else outputChatBox( "Najpierw bądź w pojeździe!", thePlayer, 255, 50, 50 ) end end end addEventHandler( "onMarkerHit", m1, naprawa ) Link to comment
Nutella Posted May 21, 2016 Author Share Posted May 21, 2016 Dimos7, your "fix" did not work. I found it out by myself. Topic to be closed. Link to comment
Recommended Posts