Guilherme Mendes Posted November 2, 2021 Share Posted November 2, 2021 Olá, alguém poderia me ajudar com o addEvent e o triggerEvent? Estou fazendo este script por fim de aprendizagem mesmo.. Enfim, queria que quando mudasse o status da roda executasse a outra função, porem não funcionou! addEventHandler ("onClientResourceStart", root, function() addEvent("fritar") end) addEventHandler("onClientRender", root, function () local veh = getPedOccupiedVehicle (localPlayer) x, y, z = getElementPosition(veh) if not veh then return false end dxDrawRectangle (0, 0, 300, 140, tocolor (0, 0, 0, 150)) dxDrawText ("FRICTION FRONT LEFT = ".. getVehicleWheelFrictionState (veh, 0), 8, 10, 290, 40, tocolor (255, 255, 255), 1.5) dxDrawText ("FRICTION FRONT RIGHT = ".. getVehicleWheelFrictionState (veh, 2), 8, 40, 290, 70, tocolor (255, 255, 255), 1.5) dxDrawText ("FRICTION REAR LEFT = ".. getVehicleWheelFrictionState (veh, 1), 8, 70, 290, 100, tocolor (255, 255, 255), 1.5) dxDrawText ("FRICTION REAR RIGHT = ".. getVehicleWheelFrictionState (veh, 3), 8, 100, 290, 130, tocolor (255, 255, 255), 1.5) if getVehicleWheelFrictionState (veh, 1) or getVehicleWheelFrictionState (veh, 3) == 1 then triggerEvent ("fritar", root) end end) function playnosom() outputChatBox ("ta fritando") --playSound3D("files/skid1.mp3", x, y, z, false) end addEventHandler ("fritar", root, playnosom) 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