Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. I had intentions to do so. I wanted to have some templates and snippets features to speed up scripting even more.
  2. Your code contains invalid function name: GetPlayerName, Lua is case-sensitive and all MTA functions start with lower case letters: getPlayerName. Loading maps is simply adding tag to meta.xml. To make stats command you can use element data to store player's stats. function playerDied(totalAmmo, killer, killerWeapon, bodypart) local pname = getPlayerName( source ) local pname2 = getPlayerName( killer ) outputChatBox(pname2.. " has Killed " ..pname) setElementData( source, "deaths", getElementData( source, "deaths" ) + 1 ); -- increase previous death count setElementData( killer, "kills", getElementData( killer, "kills" ) + 1 ); -- increase previous kill count end addEventHandler("onPlayerWasted",getRootElement(),playerDied) addEventHandler( "onPlayerJoin", getRootElement(), -- reset all the stats when they join function() setElementData( source, "deaths", 0 ); setElementData( source, "kills", 0 ); end ) addCommandHandler( "stats", -- command to show player's stats function( plr ) outputChatBox( "Your current stats (K/D): " .. getElementData( plr, "kills" ) .. "/" .. getElementData( plr, "deaths" ), plr ); end ) I set player's stats to 0 when they join so that getElementData will not return nil in onPlayerWasted and that saves you typing of "if" statements to make sure that getElementData returns number.
  3. You can post as many feature request as you want. They will eventually be added. Also, post your requests on http://bugs.mtasa.com/bug_report_advanced_page.php But before you make a report, make sure you are on "Multi Theft Auto: Script Editor" project page (TOP RIGHT corner of the page has a dropdown combobox). The way of adding new files was made quickly (within 2 hours) so it's very basic. I have plans to make a wizard (like for "New resource") where you select what file type, file name, etc.
  4. Jason_Gregory, do you even read? Maybe his English isn't the best but you can easily understand he needs code for saving weapons (even without reading whole question, just read topic title). Asi.Eren, do you want to learn Lua at all or just want us to write the code for you?
  5. You can't change the chatbox position but you can make your own custom chatbox with DX functions.
  6. Most of Lua libraries are blocked by MTA, so is io.
  7. If there is no fileWrite client-side then it's not possible. I think you didn't construct your question properly.. First, you say "i was wondering if it's possible" but then you say "i know there is no fileWrite clientside"... So basically, you answer your question in a question. Besides, you'd get error/warning if you'd want to open a file in client-side script, like guiCreateStaticImage with that streamed image because functions like guiCreateStaticImage, playSound, etc. need to know that file is available to use (). Try to place a .png image in client-side resource and try to open it with client-side script. You know the file exists but resource can't see it (no in meta.xml).
  8. These are not classes in any way. I'd like to know what you mean by classes?
  9. I made it in 2010 and tested with 8 but I haven't used functions which were added in 2010... It should work with most of 3DS Max versions. I haven't tested with versions lower than 8. Give it a try and reply here.
  10. Yes, that's a bug. You can also use something like this: for i = 1, #checkpoints - 1 do setMarkerTarget( checkpoints[i], unpack( { getElementPosition( checkpoints[i+1] ) } ) ); end
  11. I do not recommend to use getElementPosition and call it in other function calls. If you want to use the 3 returned values then create 3 variables instead. I am not sure if this will solve your issue but I'm sure it helped me the other day. for i = 1, #checkpoints - 1 do local x,y,z = getElementPosition( checkpoints[i+1] ); setMarkerTarget( checkpoints[i], x,y,z ); end
  12. 50p

    gui???

    No, until you learn to use [lua][/lua] tags.
  13. Map Exporter v0.3 DOWNLOAD Intro: Modellers know how time consuming setting up custom maps is. This tool lets modellers generate .map file automatically along with meta.xml and basic Lua script which replaces models for them (no texture support though since some custom maps only use 1 .txd file and some maps use more). Exporting maps from 3DS Max looked as follows: - export each part (model) of the map - export collision for them all - make a Lua script to replace models (not every modeller knows how to do it) - make a map file with Map Editor (it may take some time to align all the models to look seamless) - make a meta.xml with all models included in it () With this script, the process changes to: - export COL files for all your models - select all map models in 3DS Max that should be included in map file (make sure they have materials applied!) - hit "Export to .map" button (uncheck boxes if Lua script, meta.xml or DFF files are not needed, i.e. already exported) How to install and run the script: Just extract the MapExporter.ms file from MapExporter.zip to <3ds max>\Scripts\(Startup) (you don't have to extract it to Startup folder unless you want the script to be started with 3DS Max). (If you haven't installed it to \Startup folder, keep reading) Run the script from 3DS Max, "MAXScript -> Run script..." (find the MapExporter.ms script) Once the script is running, you should notice new rollout in Utilities tab "50p's MTA:SA Scripts". How to use: Select all the models you want to be exported to .map file (optionally .lua script, meta.xml and DFF models), check/uncheck the appropriate boxes and hit "Export to .map" button. Then you will be asked where to save the map file. Facts to remember: - all the files are recreated every time you export the .map, so if you have created meta.xml or .lua file already, they will be overwritten every time you export your map - If you generate Lua script, the models which will be replaced by the script start from model ID 4000+ - .lua file name is the same as .map file name - .lua and meta.xml files are created in the same directory as the .map file - .col files should be placed in the same directory as the .dff files (which is (exported map folder)\map\ ) Any questions, suggestions or bug reports please post in this topic. Thank you. NOTE: This script doesn't export .dff nor .col files. For that, you still need to use KAM's or daniska's scripts. My script generates .map, .lua and meta.xml files only to speed up map/resource creation. Didn't really know where to release this script but I think this is the most suitable place. Changelog:
  14. 50p

    need help

    Use takePlayerMoney and givePlayerMoney. They are there for a reason. setPlayerMoney will set player's money; it will not add the amount you pass in 2nd parameter. If you'll takePlayerMoney with negative value, you may see weird money behaviour (either going way too high or down too low). @COOKIE2, LEARN LEARN LEARN... You don't have source in your function anywhere... You have player in function parameter list, why don't you use it, master-helper?
  15. At least he is being honest. To my vision, xbost's script should work just fine.
  16. 50p

    racewin help :D

    Try to debug it. Before if add print some text (outputDebugString) and see if it appears in debug window.
  17. 50p

    Script for group

    the best thing is that after you hit the car change pickup it will change your color to random anyway There is an event (onPlayerPickUpRacePickup) to prevent it from happening.
  18. I do not recommend calling variables the same names as functions.
  19. Set it to 128 or 64. I can't imagine people having that long passwords though. You can set a limit yourself and tell users "Password must be longer than 3 and shorter than 64 characters." It all depends how you like it. I would personally set the limit to 32. I guess nobody uses sentences for passwords.
  20. If I remember correctly, chatbox line limit is 64 characters. People usually use chatbox to login. So if password was that long, they wouldn't be able to login with chatbox.
  21. 50p

    Script for group

    I don't know what you mean by that question.. The script changes headlight colours randomly.
  22. What line you get this error at? If you showed all your code here then you don't have player_nick variable declared anywhere. You try to get what's in table by variable which doesn't exist (thus 'nil value'). Use either: playerdata.player_nick or playerdata[ "player_nick" ].
  23. - You don't want to hide GUI and show cursor (you want to hide it when you hide window). - Also, you need GUI element as first argument in guiSetVisible. - You also, don't need 2nd argument in showCursor since by default it's true. So many "errors" in such short code. function OpenStatusWindow() guiSetVisible( GUIEditor_Window[1], not guiGetVisible( GUIEditor_Window[1] ) ) showCursor( guiGetVisible( GUIEditor_Window[1] ) ) end
  24. You can't change skin models, only textures. If you ever bothered to read wiki, you'd have known the that without asking such question here...
  25. You don't have to query twice, just do it once and send the table returned from query to client. You can send tables with trigger(Client/Server)Event easily.
×
×
  • Create New...