Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. Ok, I've managed to get some time for it and I hope I got what all of you wanted! Changes: Re-download the bank resource from the same place: https://community.multitheftauto.com/index.html?p ... ails&id=54 PS. Don't forget to report any bugs you found to improve the script! Thanks.
  2. Maybe when I have some time I'll change it to save to SQL instead of accounts.xml.
  3. Just a tip: make a for loop in clientside script.
  4. 1. What does admin function do? 2. Why do you add a handler to onClientResourceStart in a function that is called from the same event? It won't work as this event is triggered only one. 3. What does aReport function does? 4. If you use getLocalPlayer it means the script is client-side. Why do you use server events (like onResourceStart)? The last example looks the most "real" which could work. but don't add functions to events that's just been called. In the last example, if you replaced line 4 with the code that shows the report, it will work.
  5. Nobody knows when it comes out. Maybe next Christmas (lol), is it soon?
  6. Camera functions are a bit buggy in DP2. Take a look into "fallout" resource (freecamclient.lua) and you'll see there is something useful for you.
  7. getResourceRootElement() returns resource's root element and its argument is the resource element. If you admin() function returns resource element then you'd do addEventHandler( "onResourceStart", getResourceRootElement( admin() ), reportFunction ) But if you want it to be client-side (I saw in your first post getLocalPlayer) attach the report function to onClientResourceStart, not onResourceStart (this is server-side event).
  8. LOL, don't confuse people. First you say it will be released after dp3 release then you say to expect 2.0 soon!
  9. eAi does not mean to use "call" function, he means "simply call the function". As you call any other functions e.g. getRootElement()
  10. Does it actually gets called? Do you get errors? How exactly it does not work? Give more details. You may have to give "Default" (ACL) access to that function. Type "debugscript 3" in console and then try to call openAdminReport().
  11. You do not have to use "Float:", Lua uses variables and stores in them all types of data, so you don't have to tell script that this is going to be floating point number. Though, you need to tell the script that a var is a table, as you did in line 1 and 2. http://www.lua.org/manual/5.1/
  12. 50p

    Need Help

    People, read the question. He wants a command /sf which teleports you to San Fierro and displays a message. addCommandHandler( "sf", function( player ) setElementPosition( player, -2025.8760, 147.1338, 29.2072 ) outputChatBox( "Reamis now in San Fierro", player ) end )
  13. There is https://community.multitheftauto.com where you can show off and eventually point viewers to a topic in Scripting forums you made for your gamemode.
  14. In Lua if a function returns more than one value and you assign it to one variable only the first value will be assigned. You can use: local closestPlayer = tuFindNearestElement(player,"player",100) This will assign the closest player to the variable closestPlayer. The distance is also returned but it's not assigned as you use only 1 variable.
  15. Then use a function table.sort(resultTable) and see which distance is the smallest.
  16. Ace_Gambit is correct. The code is ok, but string.find, seeks for "patterns" therefore [ and ] are used to find characters between the brackets in a string. And if the characters are found it returns the character which was found or a number at which place it was found. Visit the link below. For example: string.find( "PS2", "[PS]" ) -- should return P or 1 http://lua-users.org/wiki/PatternsTutorial
  17. You spoke about it on IRC, so maybe you'll see some fix for it in the final release or maybe in dp3. Don't be surprised if it won't be fixed at all as I think it's the way GTA was made.
  18. You wouldn't have to rewrite the mapsystem. Just create colshape instead of marker. You still get the coords from "map" then just take away 10 from the x ad 10 to x and take away 10 from y & add 10 to y, so it will make your colshape a square. That's just an idea, you can always ignore it.
  19. Why not creating a colshape and start refilling when player stops completely?
  20. 50p

    How i can 2?

    Sorry, that was a quick reply... Try to make a table in a table before assigning values. Eg. spawns = { } spawns[1] = { } -- table should be created on each spawns index, like: spawns[2] = { }, etc. spawns[1].x = 123.2494
  21. 50p

    How i can 2?

    Read my previous post. You can make it yourself and be proud at the same time.
  22. If you still don't know where all 19 petrol stations are I'll give you a map which shows where they are, here: http://img143.imageshack.us/img143/2161 ... mapjg9.jpg
  23. 50p

    How i can 2?

    In file broph.lua there is a function spawnThePlayer, you'll need to change the coords there. To make a random spawn points you'd need to make a table and store the spawns' coords in there. Eg.: local spawns = { } spawns[1].x = 123.4567 spawns[1].y = 234.5678 spawns[1].z = 345.6789 spawns[1].rot = 46.7891 spawns[2].x = 423.2495 spawns[2].y = 453.2564 spawns[2].z = 564.6321 spawns[2].rot = 120.6928 local rnd = math.random( #spawns ) spawnPlayer( player, spawns[rnd].x, spawns[rnd].y, spawns[rnd].z, spawns[rnd].rot )
  24. To add a used to a group you'll need just add one line: Just change from Console to the nickname you want to add.
  25. 50p

    How i can?

    As I said I haven't added any commands, so probably you'll have to write them on a piece of paper EDIT: Updated... it saves coords now.
×
×
  • Create New...