MaskedBR Posted February 14, 2016 Share Posted February 14, 2016 Hello guys! I need your help , but I want to apologize for my bad English. I want a script that when the player enters / command o < nick > is teleported to the trunk of the vehicle ( Bushwacker ) . But I do not even know where to start .. Help me ! Link to comment
Dimos7 Posted February 15, 2016 Share Posted February 15, 2016 function getPlayerFromPatrialName(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 function jailTrunk(thePlayer, targetPlayer, _) if targetPlayer then if (getPlayerFromPatrialName(targetPlayer)) then targetPlayer(getPlayerFromPatrialName(targetPlayer)) if targetPlayer ~= thePlayer then if isPedInVehicle(thePlayer) then local theVehicle = getPedOccupiedVehicle(thePlayer) warpPedIntoVehicle(targetPlayer, theVehicle, 4) end end end end end addCommandHandler("tjail", jailTrunk) jailTime = setTimer(jailTrunk, 5000, 1) function unjailedTurnk(thePlayer, targetPlayer) killTimer(jailTime) if getTimerDetails(jailTime) == 0 then if targetPlayer then if (getPlayerFromPatrialName(targetPlayer)) then targetPlayer(getPlayerFromPatrialName(targetPlayer)) removePedFromVehicle(targetPlayer) end end end end Link to comment
MaskedBR Posted February 15, 2016 Author Share Posted February 15, 2016 But I needed the player to be directed to the trunk of the vehicle 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