Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. It's been a debated. You can compile lua scripts and client can run compiled scripts, but if they want they can decompile the file and see the source. I haven't seen decompiler for Lua 5.1, so you can give it a try.
  2. I remember I had similar problem with gui functions when gui elements are not created in onClientResourceStart. In some recent topic somebody said that he had the same solution.
  3. 50p

    Script help

    In your code: 1. You give killer money if somebody dies not getting hit 2. You give $1000 if player was not killed in the head 3. You give $250 if player is killed That's why you get $1250 when you kill somebody. Try this one: addEventHandler( "onPlayerDamage", getRootElement(), function( attaker, weap, bodypart ) -- attach an anonymous function if attacker and getElementType( attacker ) == "player" then -- check if attacker is player if bodypart == 9 then -- if player hit your head, give him 1000 givePlayerMoney( attacker, 1000 ) else -- if any other part, just give him 250 givePlayerMoney( attacker, 250 ) end end end )
  4. 4-posts are definetely not allowed! USE EDIT BUTTON ON THE RIGHT!
  5. AFAIR, somebody already tried to replace a weapon model and it didn't work.
  6. http://development.mtasa.com/index.php? ... troduction http://development.mtasa.com/index.php? ... ipting_GUI
  7. Some people won't want to be randomly called in game some will want to be ex-directory I'd rather it have the option to add people to a contacts list, than display EVERYONE'S numbers. You could add a checkbox or radio, so if the box is checked you mark this number to be allowed to be seen in "Yello Pages"
  8. 50p

    Script help

    Try debugging (add some outputChatBox, outputDebugString, etc. in gateClose).
  9. 50p

    Script help

    Well, you can call moveObject function. But before you change your code, do you get any errors when you leave the colshape or does it actually get triggered? Debug the script, http://development.mtasa.com/index.php?title=Debugging
  10. If you're using 3ds max, you can't just rotate the object. Remember, when you export an object it has to be placed at 0,0,0 and rotated 0,0,0. So how to make an object rotated? Here is the solution: 1. Select the object 2. Click on Hierarchy tab on the right (where you have Create, Modify, etc.) 3. You should have 3 buttons there (Affect Pivot Only, Affect Object Only and Affect Hierarchy Only), click on Affect Pivot Only 4. Now you should see the arrows (X, Y and Z directions) got greater, you can now rotate/move these arrows around the scene and that will be centre of the object. If you move this to the centre of the object and you place the object in-game (without changing coords) you will see the object has changed its position but you never changed it, that's because object is moved to the place of Pivot location. 5. When you are done with rotating/moving these arrows, click Affect Pivot Only again 6. Now you have to prepare the object for exporting, so select Move Tool, press F12 and set X, Y and Z to 0 (in Absolute:World). Do the same for Rotation, now your object should look like object created in game without rotations.
  11. 50p

    Script help

    moveObject has 8 params, you have 9. That's probably why it doesn't move.
  12. How do i learn to use tables?? http://www.lua.org/pil/2.5.html
  13. Well, you could use maths to calculate what part of the vehicle was hit, but most of the vehicles have different shape, so every vehicle would have to be calculated with different values. You don't want to make ~200 functions or a table which would hold all the vehicles' size, do you? And in addition, vehicle's collision is simplified to take less memory and faster rendering so it wouldn't be accurate anyway.
  14. If you mean onClientPlayerWeaponFire then you will just get the coords (world x, y and z) and the element that client hit (not exact part of it).
  15. 50p

    Script help

    You don't give markers name, it's just a name of variable which holds a "pointer" to a marker. You should start from reading lua manual not ready scripts, find out what's a variable, table, function, how they work and then wiki will be usefull for you. http://www.lua.org/manual/5.1/ http://www.lua.org/pil/index.html
  16. http://development.mtasa.com/index.php? ... ayerDamage For players, there isn't such event for vehicles and probably won't be.
  17. Description: Hi everybody! I have a news for people who always wanted to hash string in Lua! I made a modules which hashes string for you, so you can use it to hash passwords and your users won't complain about admins being able to read their passwords. But, I have never programmed for Linux, I don't have access to Linux OS and therefore I couldn't compile it to .so. I'd appreciate if there was somebody who could compile it for Linux system! I heard that some 2 scripts are required to compile it, but as I said I've never programmed for Linux. I don't know why they are needed and what they do... Installation: Follow instructions on wiki, https://wiki.multitheftauto.com/index.ph ... es/hashing Functions: alder32 (I do not recommend using it, use MD5 instead) md5 Download: Up-to-date download link should be on wiki, here: https://wiki.multitheftauto.com/index.ph ... es/hashing (Source code included)
  18. http://development.mtasa.com/index.php? ... ges_in_DP3
  19. https://community.multitheftauto.com/index.html?p=resources Find speedometer on the list. Color names: start broph resource and you will have colored names.
  20. Use only 1 = So for example "lastname = '" .. name .. "'"
  21. If stats are saved in a MySQL then you can connect to MySQL using PHP easily. If you store stats in XML or SQL and if you want to display the stats on an external website, you'd have to create (eg. a PHP) script which connects to the server, gather the data from XML or SQL and return this data to the PHP script. When you get the data back, you can display them on the website.
  22. 50p

    countdown script

    It looks like IRC script... this section of forum deals with Lua.
  23. Yes, it would be. You could getTickCount( ) when player right-click and getTickCount( ) when a player dies. Then compare the values and see if the difference is greater then the specified amount of milliseconds.
  24. Do you think player can kick himself? If you allow them in acl.xml then yes. You sould kick them using Console element, like: getElemetsByType( "Console" )[ 1 ]
×
×
  • Create New...