Jump to content

[HELP] Please :x


GrubaS

Recommended Posts

setTimer( 
function ( p,c,thePlayer) 
    local target = getPlayerFromPartialName(thePlayer) 
    if target then 
    local handling = getVehicleHandling(target) 
    if handling > 1200 then 
    outputChatBox(getPlayerName(target).." - mass: "..handling[1]) 
end 
end 
end, 2000, 1) 
  
function getPlayerFromPartialName(name) 
    local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil 
    if name then 
        for _, player in ipairs(getElementsByType("player")) do 
            local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() 
            if name_:find(name, 1, true) then 
                return player 
            end 
        end 
    end 
end 

Link to comment

That code makes no sense, it looks like you've just aimlessly scraped together some code from various sources.

The timer will run once after 2 seconds, and then use 'thePlayer' which hasn't even been passed via the timer. getVehicleHandling returns a table not an integer.

Link to comment

Let alone that you're comparing a table (handling) to a number.

There is no event for changing any of the handling data of a car. You will have to add the check code (or triggerEvent) to the part where the player changes the mass of the vehicle.

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