Jump to content

problem . Script Push


matito6

Recommended Posts

Welcome . I have a script to push. When you enter the command /push Euro (Euro is nick something like this)

it nothing happens. I used to get this to work because I had to change something in lua. now I can not remember what I changed .... Please help

function pushim (thePlayer, commandName, ...) 
    local player = findPlayer(...) 
    if (not player) then 
        outputChatBox("* /push: player not found", thePlayer) 
        return 
    end 
    if isPedInVehicle(player) then 
        local vehicle = getPedOccupiedVehicle(player) 
        x,y,z = getElementVelocity(vehicle) 
        setElementVelocity ( vehicle, x, y, z+0.30) 
        outputChatBox( getPlayerName(thePlayer)..  " Push "  ..getPlayerName(player), getRootElement(), 255, 255, 0, true) 
    end   
end 
addCommandHandler("push", pushim) 
  
function findPlayer(namepart) 
    local player = getPlayerFromName(namepart) 
    if player then 
        return player 
    end 
    for _,player in ipairs(getElementsByType("player")) do 
        if string.find(string.gsub(getPlayerName(player):lower(),"#%x%x%x%x%x%x", ""), namepart:lower(), 1, true) then 
            return player 
        end 
    end 
return false 
end 

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