Jump to content

Gravity


Recommended Posts

Wow, credits. This is the opportunity of a lifetime, people. :roll:

Seriously, this is three lines of code, you should be able to take 5 minutes and write those down for yourself.

You also save 1 piece of credits. ;)

Links that will be of use:

http://development.mtasa.com/index.php?title=Resources

http://development.mtasa.com/index.php?title=Meta.xml

http://development.mtasa.com/index.php? ... andHandler

http://development.mtasa.com/index.php?title=SetGravity

Link to comment
Fyfi I dont know how to script thats why im asking anybody if they could make me a dmn gravity script why else do you think I posted this :roll:

Because you're too lazy to try 5 minutes of scripting?

I just didn't feel like handing you the solution on a silver platter since you apparently don't even care enough to make an effort. I did, however, hand you on a silver platter, everything you should need if you use your brain for a bit.

Link to comment
did you not see what I wrote I cant script

I'm pretty sure robhol and I didnt know how to script either before we started. And for YOUR information, I doubt any of us has learned that in university :P

But really, unless you happen to be someone with great favours to the community, I doubt that anyone is just going to give everything you want just because you want..

And if you really need it, learn scripting, it really pays off.

If you need guidance with some problems, we are happy to help, however we aren't going to write the scripts for you.

Link to comment

Sheesh all this negativity.. :roll:

If you don't have anything good to say, DON'T say anything! All he asked for was a few lines of code, cuz he's a newbie. If you're a scripter, it doesn't take more to write that piece of code than tell him to "STFU do it yourself!". Everybody has to start somewhere, eventually he'll be able to write his own scripts.

@Legend:

This should go in a file called gravity.lua (or in your gamemode):

function setGravity ( player, commandName, level ) 
    setGravity ( tonumber ( level ) ) 
end 
  
function consoleSetPlayerGravity ( player, commandName, level ) 
    if ( player ) then 
        local success = setPedGravity ( player, tonumber ( level ) ) 
        if (not success) then 
            outputConsole( "Failed to set player gravity", player ) 
        end 
    end 
end 
  
addCommandHandler ( "setgravity", setGravity ) 
addCommandHandler ( "setplayergravity", setPlayerGravity ) 

meta.xml:

>    ="gravity.lua" />>

The setgravity command changes the gravity for the whole server and setplayergravity for the player only, as you can see scripting is not that hard you just need to practice a bit and you'll get the hang of it, if you have any further questions about how the script works than we'll be happy to help you, right robhol? :tongue3:

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