matito6 Posted July 24, 2012 Share Posted July 24, 2012 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
Castillo Posted July 24, 2012 Share Posted July 24, 2012 Here it works, I used the command on myself and it pushed me. Link to comment
xTravax Posted July 25, 2012 Share Posted July 25, 2012 Hello,here is LR//Head Owner,In my server i write /push Gustavo and it doesn't work but,When i write /push Gustavo Gustavo it pushes me.So check it please. 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