Jump to content

Use Rotation and Direction


Alexs

Recommended Posts

Hi Everyone, SolidSnake14 Help me with this but i dont know how to finish it.

addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        bindKey ( source, "L", "down", crear ) 
    end 
) 
  
addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        ramps = { } 
        for index, player in ipairs ( getElementsByType ( "player" ) ) do 
            bindKey ( player, "L", "down", crear ) 
        end 
    end 
) 
  
function crear ( player, key, keyState ) 
    local mx, my, mz = getElementPosition ( player ) 
    local accame = getAccountName ( getPlayerAccount ( player ) ) 
     if isObjectInACLGroup ( "user.".. accame, aclGetGroup ( "Admin" ) ) then 
        ramps [ player ] = createObject ( 1634, mx + 5, my, mz ) 
        setTimer ( 
            function ( theRamp ) 
                if ( theRamp ) then 
                    destroyElement ( theRamp ) 
                end 
            end 
            ,3000, 1, ramps [ player ] 
        ) 
    end 
end 

The Problem is on coordinates, if i am going to west the ramp spawn in my side and no in my front, how i can fix it?

Link to comment

u need to get the coords a set distance in front of the player...

theres a few calculations u can do to get this... sadly i dont have time to write it..

but theres already a community ramps script... u can look in there for how they get the position in front of the player...

or just use the script/edit it to how u want it.

https://community.multitheftauto.com/index.php?p=resources&s=details&id=92

sorry i dont have time to write it for u... although im sure if u get stuck, someone will have more time to help u.

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