Jump to content

Forgot Function


toptional

Recommended Posts

Guys...
fixVehicle ( vehicle theVehicle ) 
  
theVehicle: The vehicle you wish to fix 

I dont want a specific Vehicle to be fixed, i want any vehicle that enters this marker to be fixed, how to i make it any vehicle instead of just 1

Remember its Cars/Planes and others

Eh... it fixes the vehicle you wish to fix. For example...

Server-side

addCommandHandler("fixme", 
    function(player, cmd) 
        local vehicle = getPedOccupiedVehicle(player) 
        if vehicle then 
            fixVehicle(vehicle) 
        end 
    end 
) 

Or...

Server-side

addEventHandler("onMarkerHit", root, 
    function(hitElement, matchingDimension) 
        if getElementType(hitElement) == "vehicle" and matchingDimension then 
            fixVehicle(hitElement) 
        end 
    end 
) 

Link to comment
Guys...
fixVehicle ( vehicle theVehicle ) 
  
theVehicle: The vehicle you wish to fix 

I dont want a specific Vehicle to be fixed, i want any vehicle that enters this marker to be fixed, how to i make it any vehicle instead of just 1

Remember its Cars/Planes and others

Eh... it fixes the vehicle you wish to fix. For example...

Server-side

addCommandHandler("fixme", 
    function(player, cmd) 
        local vehicle = getPedOccupiedVehicle(player) 
        if vehicle then 
            fixVehicle(vehicle) 
        end 
    end 
) 

Or...

Server-side

addEventHandler("onMarkerHit", root, 
    function(hitElement, matchingDimension) 
        if getElementType(hitElement) == "vehicle" and matchingDimension then 
            fixVehicle(hitElement) 
        end 
    end 
) 

Well i didnt need you to make me the script lol, Thanks anyway

Link to comment

Related to this topic, Whats wrong with this?

airportLSMarker = createMarker ( 13.60000038147, -2390.8000488281, 1858.0999755859, "cyclinder" , 10, 255, 0, 0, 180) 
  
function airportMarkerHitLS ( hitPlayer, matchingDimension ) 
    if getElementType(hitElement) == "vehicle" and matchingDimension then 
            fixVehicle(hitElement) 
    end 
end 
addEventHandler ( "onClientMarkerHit", airportLSMarker, airportMarkerHitLS ) 

Got this error

WARNING : server.lua Bad Arguement at add eventhandler [Expected element at arguement 2, got bootlearn]

Link to comment
Related to this topic, Whats wrong with this?
airportLSMarker = createMarker ( 13.60000038147, -2390.8000488281, 1858.0999755859, "cyclinder" , 10, 255, 0, 0, 180) 
  
function airportMarkerHitLS ( hitPlayer, matchingDimension ) 
    if getElementType(hitElement) == "vehicle" and matchingDimension then 
            fixVehicle(hitElement) 
    end 
end 
addEventHandler ( "onClientMarkerHit", airportLSMarker, airportMarkerHitLS ) 

Got this error

WARNING : server.lua Bad Arguement at add eventhandler [Expected element at arguement 2, got bootlearn]

server.lua

onClientMarkerHit

In other words, you are using a client-side event server-side, which is not possible.

Link to comment
function airportMarkerHitLS ( hitPlayer, matchingDimension )

fixVehicle(hitElement)

Huh? It already is that...

Client

airportLSMarker = createMarker ( 13.60000038147, -2390.8000488281, 1858.0999755859, "cyclinder" , 10, 255, 0, 0, 180) 
  
function airportMarkerHitLS ( hitPlayer, matchingDimension ) 
    if getElementType(hitElement) == "vehicle" and matchingDimension then 
            fixVehicle(hitElement) 
    end 
end 
addEventHandler ( "onClientMarkerHit", airportLSMarker, airportMarkerHitLS ) 

Link to comment
function airportMarkerHitLS ( hitPlayer, matchingDimension )

fixVehicle(hitElement)

Huh? It already is that...

Nice joke.

You are putting wrong argument. Can't you even see it? :o

Also your script must be server side, because fixVehicle client side won't change anything for other players.

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