Jump to content

[REL] Basketball 0.0.1


fmj02

Recommended Posts

Instruction:

1. Press 'k' to get the ball.

2. Move mouse to rotate player.

3. Controls:

OFFENSIVE MOVES:

'w' - run

'shift' - walk

'left mouse button' - jump shot

'right mouse button' - dunk

DEFENSIVE MOVES:

'w' - run

'a' - step left

'd' - step right

4. How to stop play?

- Just press 'k' again.

5. Where can I get the ball?

- Use /createball command, and the ball will appear on the ground.

If you want to create more balls just /createball command again.

6. There are any courts to play in basketball?

- Just use /court command that will automatically warp you to the court.

7. I can use it on my server?

- Yes, you can freely use it on your server.

8. It is possible to make soccer?

- Yes, but you need new anims like kick etc.

9. Why I never miss?

- It's unstable version only for test first poor object dynamic,

something like "luck" I'll make in next version.

DOWNLOAD:

https://community.multitheftauto.com/index.php?p= ... ls&id=4676

UNSTABLE VERSION!

Link to comment

I made this when you're shooting :

  
  
function dynamic_shoot() -- passed 
    targetX,targetY,targetZ = 2880.6000976563, 2185.5000976563, 13.10000038147 
    x,y,z = getElementPosition(ball) 
    distanciaX = targetX - x 
    distanciaY = targetY - y 
    distanciaZ = targetZ - z 
    xP = distanciaX / 2 
    yP = distanciaY / 2 
    zP = distanciaZ / 2 
    timerShoot = setTimer(function ()  
    x = x + xP 
    y = y + yP 
    z = z + zP + 0.08 
    setElementPosition(ball,x,y,z) end,500,2) 
    setTimer( 
    function() 
    moveObject(ball,500,targetX,targetY,targetZ-3) 
    killTimer(timerShoot) 
    end 
    ,1000,1) 
end 
  

:)

I edited it, perhaps could be better with that :)

Link to comment

Here guys, another way I made...I'm not so good at maths but well perhaps is good for now.

  
function dynamic_shoot() -- passed 
    local x,y,z = getElementPosition(localPlayer) 
    setTimer(function() setElementPosition(ball,hX,hY,hZ+0.6) end,500,1) 
    setTimer(function() addEventHandler("onClientRender",root,tirando) end,1000,1) 
end 
  
function tirando() 
    targetX,targetY,targetZ = 2880.6000976563, 2185.5000976563, 13.10000038147 
    x,y,z = getElementPosition(ball) 
    distanciaX = targetX - x 
    distanciaY = targetY - y 
    distanciaZ = targetZ - z 
    xP = distanciaX / 10 
    yP = distanciaY / 10 
    zP = distanciaZ / 10 
    if rumboBalon <= 10 then 
    x = x + xP 
    y = y + yP 
    z = z + zP + 0.15 
    setElementPosition(ball,x,y,z) 
    rumboBalon = rumboBalon + 1 
    elseif rumboBalon > 10 and rumboBalon < 25 then 
    x = x + xP 
    y = y + yP 
    z = z + zP - 0.04 
    setElementPosition(ball,x,y,z) 
    rumboBalon = rumboBalon + 1 
    elseif rumboBalon >= 25 and rumboBalon < 37 then 
    x = x + xP 
    y = y + yP 
    z = z + zP 
    setElementPosition(ball,x,y,z) 
    rumboBalon = rumboBalon + 1 
  
    elseif rumboBalon == 37 then 
    local mover = moveObject(ball,1000,targetX,targetY,targetZ-3) 
  
        removeEventHandler("onClientRender",root,tirando) 
        rumboBalon = 0  
        end 
   end 
  
  

Link to comment

you could just use this

    setTimer(attachElements, 250, 1, ball[thePlayer], thePlayer, 0.2, .30, -0.09) -- 1st frame 
    setTimer(attachElements, 320, 1, ball[thePlayer], thePlayer, 0.2, .40, 0.4) -- 2nd frame 
    setTimer(attachElements, 390, 1, ball[thePlayer], thePlayer, 0.2, .40, 0.7) -- 3rd frame 
    setTimer(attachElements, 460, 1, ball[thePlayer], thePlayer, 0, .50, 1) -- 4th frame 
    setTimer(attachElements, 530, 1, ball[thePlayer], thePlayer, 0, .50, 1.5) -- 5th frame 
    setTimer(attachElements, 600, 1, ball[thePlayer], thePlayer, 0, .90, 1.7) -- 6th frame 
    setTimer(attachElements, 670, 1, ball[thePlayer], thePlayer, 0, 1.30, 1.-- s8) --> -- 7th frame 
    setTimer(attachElements, 740, 1, ball[thePlayer], thePlayer, 0, 1.70, 1.9) -- 8th frame 
    setTimer(attachElements, 810, 1, ball[thePlayer], thePlayer, 0, 2.0, 2) -- 9th frame 
    setTimer(attachElements, 880, 1, ball[thePlayer], thePlayer, 0, 2.30, 2.1) -- 10th frame 
    setTimer(attachElements, 950, 1, ball[thePlayer], thePlayer, 0, 2.70, 2.2) -- 11th frame 
    setTimer(attachElements, 1020, 1, ball[thePlayer], thePlayer, 0, 3.10, 2.3) -- 12th frame 
    setTimer(attachElements, 1090, 1, ball[thePlayer], thePlayer, 0, 3.55, 2.3) -- 13th frame    
    setTimer(attachElements, 1160, 1, ball[thePlayer], thePlayer, 0, 3.55, 2) -- 14th frame 
    setTimer(attachElements, 1230, 1, ball[thePlayer], thePlayer, 0, 3.55, 1.6) -- 15th frame 
    setTimer(attachElements, 1300, 1, ball[thePlayer], thePlayer, 0, 3.55, 1.3) -- 16th frame 
    setTimer(attachElements, 1370, 1, ball[thePlayer], thePlayer, 0, 3.55, 1.0) -- 17th frame 
    setTimer(attachElements, 1440, 1, ball[thePlayer], thePlayer, 0, 3.55, 0) -- 18th frame 
    setTimer(attachElements, 1510, 1, ball[thePlayer], thePlayer, 0, 3.55, -0.6) -- 19th frame 
    setTimer(attachElements, 1580, 1, ball[thePlayer], thePlayer, 0, 3.55, -0.10) -- 20th frame 
    setTimer(attachElements, 1650, 1, ball[thePlayer], thePlayer, 0, 3.55, -0.20) -- 21th frame 
    setTimer(attachElements, 1720, 1, ball[thePlayer], thePlayer, 0, 3.55, -0.30) -- 22th frame 
    setTimer(attachElements, 1800, 1, ball[thePlayer], thePlayer, 0, 3.55, -0.90) -- 23th frame 
    toggleAllControls(thePlayer, false, false, false) 

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