Jump to content

[HELP] onClientVehicleExit


Firespider

Recommended Posts

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
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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...