Hello guys, today i tried to make an traffipax script, but i got this error code:
server.lua:212: Bad argument @ 'getPedOccupiedVehicle' [Expected ped at argument 1, got vehicle]
Here is the code:
local s1321321 = createColRectangle ( 1816.85632, -1793.69824, 13.38281, 1, 1)
function bunti ( source )
local vehicle = getPedOccupiedVehicle(source)
local velx, vely, velz = getElementVelocity( vehicle )
local speed = (velx ^ 2 + vely ^ 2 + velz ^ 2) ^ (0.5)
local kmh = math.floor(speed * 180 )
local mgng = 50
local tul = kmh - mgng
if theVehicle then
if kmh > 50 then
outputChatBox("#ff0000 *TRAFFIPAX* Sebességkorlát: 50km/h", source, 255, 194, 14, true)
outputChatBox("#ff0000 *TRAFFIPAX* Sebességed:" ..kmh.. ". Bírság: 30000 Ft. Levonva a készpénzedből vagy a bankszámládról.", source, 255, 194, 14, true)
outputChatBox("#ff0000 *TRAFFIPAX* Túllépés:" ..tul.."km/h.", source, 255, 194, 14, true)
end
end
end
addEventHandler ( "onColShapeHit", s1321321, bunti )
Solved.