local p = thePlayerlocal vh = getPedOccupiedVehicle(getLocalPlayer()) local kmh = getElementSpeed(vh), getElementSpeed(vh, 0)local roundedSpeedkmh = math.floor(kmh) == kmhfunction Check(p, vh)if isPedInVehicle then vh() kmh()elseendendfunction Speed(kmh)if kmh == 70 then outputChatBox(\"Sebességed 70 km/h! Lassíts le, különben 10 másodpercen belül felrobbansz!\") elseendendsetTimer(Speed, 10000, 0)
local roundedSpeedkmh = math.floor(kmh) == kmh
function Speed(kmh)if kmh = 70 outputChatBox(\"Sebességed 70 km/h! Lassíts le, különben 10 másodpercen belül felrobbansz!\") blowVehicle(vh)elseendend
local roundedSpeedkmh = math.floor(kmh)
if kmh = 70
if kmh == 70 then
Ja, hát néztem én is, elég érdekes, a getElementSpeed nem alap MTA-s funckció, az megvan?
function getElementSpeed(theElement, unit) -- Check arguments for errors assert(isElement(theElement), \"Bad argument 1 @ getElementSpeed (element expected, got \" .. type(theElement) .. \")\") local elementType = getElementType(theElement) assert(elementType == \"player\" or elementType == \"ped\" or elementType == \"object\" or elementType == \"vehicle\" or elementType == \"projectile\", \"Invalid element type @ getElementSpeed (player/ped/object/vehicle/projectile expected, got \" .. elementType .. \")\") assert((unit == nil or type(unit) == \"string\" or type(unit) == \"number\") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == \"m/s\" or unit == \"km/h\" or unit == \"mph\"), \"Bad argument 2 @ getElementSpeed (invalid speed unit)\") -- Default to m/s if no unit specified and \'ignore\' argument type if the string contains a number unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit)) -- Setup our multiplier to convert the velocity to the specified unit local mult = (unit == 0 or