Firespider Posted March 27, 2023 Share Posted March 27, 2023 Hello! This part of the script doesn't work for some reason, but I don't know why I don't need a little help. Do not issue any error codes. addEventHandler("onVehicleExit", resourceRoot, function(player, seat) if (player == client) then local vehicle = getPedOccupiedVehicle(client) if (vehicle) then if (vehicle == getElementData(client, "Jobveh")) then if (seat == 0) then outputChatBox("#1db8b5[Munka]#549c6bSikeressen leadtad a munka járművedet", client, 0, 0, 0, true) end end end end end ) Link to comment
AngelAlpha Posted March 27, 2023 Share Posted March 27, 2023 18 minutes ago, Firespider said: Hello! This part of the script doesn't work for some reason, but I don't know why I don't need a little help. Do not issue any error codes. addEventHandler("onVehicleExit", resourceRoot, function(player, seat) if (player == client) then local vehicle = getPedOccupiedVehicle(client) if (vehicle) then if (vehicle == getElementData(client, "Jobveh")) then if (seat == 0) then outputChatBox("#1db8b5[Munka]#549c6bSikeressen leadtad a munka járművedet", client, 0, 0, 0, true) end end end end end ) client.lua addEventHandler("onClientVehicleExit", resourceRoot, function(player, seat) if (player == localPlayer) then local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle) then if (vehicle == getElementData(localPlayer, "Jobveh")) then if (seat == 0) then outputChatBox("#1db8b5[Munka]#549c6bSikeressen leadtad a munka járművedet", 0, 0, 0, true) end end end end end ) meta.xml <meta> <script src="client.lua" type="client"/> </meta> Link to comment
Doongogar Posted March 28, 2023 Share Posted March 28, 2023 16 hours ago, Firespider said: Hello! This part of the script doesn't work for some reason, but I don't know why I don't need a little help. Do not issue any error codes. addEventHandler("onVehicleExit", resourceRoot, function(player, seat) if (player == client) then local vehicle = getPedOccupiedVehicle(client) if (vehicle) then if (vehicle == getElementData(client, "Jobveh")) then if (seat == 0) then outputChatBox("#1db8b5[Munka]#549c6bSikeressen leadtad a munka járművedet", client, 0, 0, 0, true) end end end end end ) you don't need to use getPedOccupiedVehicle to have the vehicle element, since the event revolves around the vehicle, its argument is already defined as source Link to comment
Firespider Posted March 28, 2023 Author Share Posted March 28, 2023 Doesn't working. But thanks for that But it works, I just didn't delete a part, thanks. Link to comment
AngelAlpha Posted March 29, 2023 Share Posted March 29, 2023 On 28/03/2023 at 14:39, Firespider said: Doesn't working! my code will only work with vehicles that have been created in this resource On 28/03/2023 at 15:57, Firespider said: Doesn't working. But thanks for that But it works, I just didn't delete a part, thanks. show pls all your code Link to comment
Firespider Posted March 29, 2023 Author Share Posted March 29, 2023 I solved it, thanks 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