Jump to content

Lordy

Members
  • Posts

    290
  • Joined

  • Last visited

Everything posted by Lordy

  1. In nightlys it should be possible to put a ped into the driver's seat and then setPedControlState to make him turn left, right I guess. need to test it
  2. I believe you would want to use createBlip function.
  3. Lordy

    Cars Help..

    in a lua file, inside a resource
  4. Kinda odd nobody noticed declaring a var like var = value, anothervalue, anothervalue... you can assign only one value to a variable.. So I would just make them into a table spawnPoints[1] ={ 0, 0, 5} spawnPoints[2] = {0, 500, 5} spawnPoints[3] = {500, 0, 5} spawnPoints[4] = {1000, 0, 5} and later use spawnPlayer(source, spawnPoints[randomSpawn][1],spawnPoints[randomSpawn][2],spawnPoints[randomSpawn][3])
  5. Lordy

    onPlayerWasted

    http://development.mtasa.com/index.php? ... ayerWasted onPlayerWasted gives parametes int totalAmmo, element killer, int killerWeapon, int bodypart [, bool stealth ] The player who died is the source.. And killer is the second argument in function().
  6. Or toggleVehicleRespawn
  7. look at line 5.. base.xml just as this, is trying to access a table called base with a key "xml".. You have to put the passwordXML variable there instead
  8. You know that you can get the size of the indexed array (as well as a length of a string) with #? like local array = {"dsa","dsa","dsa","dsa","sda"} local i = #array -- and i == 5
  9. Thehookerkiller01. You were already told to stop "helping" people until you don't know jack shit. http://development.mtasa.com/index.php? ... nePosition and set the cigars position/rotation onClientRender for example
  10. Camera functions changed a lot from dp2 to nightlys. So my guess is they don't work. They are not so hard to code though.
  11. If I recall correctly, Talidan told me that all the engine functions were element based at the beginning, but it was unstable, so they made them global..
  12. Lordy

    Gravity

    Maybe he wants it available to all ppl
  13. Sometimes looking at the error it outputs helps. "Attempting to index a global " a nil value means that you don't have the table defined anywhere. Like the armed_Window needs to be a table, before you can add indexes to it. Just add armed_Window = {} before it.
  14. There are uberzillion threads about map editor around here. Please look around. For example: https://forum.multitheftauto.com/viewtop ... 66#p290066
  15. Lordy

    Gravity

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

    Some Questions

    The script won't run anyway if you don't have correct syntax. So there is no point testing it. isVehicleOnGround needs a vehicle element argument. So you have to check what are you giving the function.. Put outputChatBox(getElementType(rcbaron)) before "if isVehicleOnGround" thingie and fix syntax problems. Then test it and tell us what you get.
  17. You can make user input them with either addCommandHandler or a gui input box.. There you get a string.. To get five numbers out of it you can do this function returnNumbers (stringnumber) if tonumber(stringnumber) and string.len(stringnumber) == 5 then -- we use tonumber to see if all the contents are numbers, string.len is to see how long is the string -- So we have a string which consists of 5 numbers -- Now we extract the numbers from string local one = tonumber(string.sub(stringnumber,1,1))-- string.sub finds a substring at the position we defined, currently starts at first char and ends there local two = tonumber(string.sub(stringnumber,2,2)) local three = tonumber(string.sub(stringnumber,3,3)) local four = tonumber(string.sub(stringnumber,4,4)) local five = tonumber(string.sub(stringnumber,5,5)) -- We also used tonumber to convert the string to an integer -- so we have successfully split the string into separate numbers return one,two,three,four,five -- Return allows the function to be used elsewhere and it also stop the function end return false -- If the first if statement didn't go through, then the previous return didn't end the function and it should return false end ------------------------------------------------------------------------------------------ --stringnumber = "11234" -- This is the number that we got from addCommandHandler or inputbox ------------------------------------------------------------------------------------------- -- Now we use this function like this inside some other func. local one,two,three,four,five = returnNumbers(stringnumber) -- And we got five little variables, if the stringnumber was 5 characters long and consisted only of numbers -- one would be 1, two 1, three 3, four 3, five 4
  18. What kind of help do you need? Are you totally new to Lua or you have some basic knowledge? But anyway, http://development.mtasa.com/index.php? ... troduction Scripting introduction to MTA, you need this really http://development.mtasa.com/index.php? ... ng_the_GUI If you want to make the red/green thingie with GUI then you need this also http://lua-users.org/wiki/StringLibraryTutorial You probably will need either this and string.sub() function too, but turn here once you've understood basics. If you already have knowledge about these things, I'd recommend just trying out with dx functions to show the colour. I might even make a little example.
  19. Lordy

    Some Questions

    Then add a second event handler to the function too.. I can't see a problem
  20. WORMS YAY!. Can also other weapons be used while being on wall?
  21. iirc Catalina's bank job interior is built in the main world, interior 0 not another interior.. Might be wrong though
  22. I guess that when you attach, you write object[player] = the attached object.. So every time you attach, you overwrite object[player].. You can use object[player] = {} and then put table.insert(object[player], theElement) or something like that, so each of the attached elements would have it's own identifier.. Currently you are just overwriting the variable every time, since the player is constantly the same for the same client.
  23. I think Willy's point is more in the direction that you don't want someone to write your code if they don't know what a bool is, or if they do == instead of =, or refuse to read the wiki, or refuse to use their brain... But on the other hand, the one who didn't know what a bool is also wants to quite copy some existing features from servers around.. And by implementing them crappily, he does make a lagger fail copy of some other feature in another server
  24. Wise words, since you really wouldn't want to have a lagger copy server of some another failed attempt. But if they float your boat, then use whoever you like
  25. Well you can create custom camera angles with onClientRender and setCameraMatrix I think.. And then have the crosshair with either a static image or dx funcs
×
×
  • Create New...