Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. My votedata contains only poll settings (that's what you want), then (look at line 34) I call the function I wrote which add the maps to votedata table and returns this table (the returned table is then reassigned to votedata with maps inside).
  2. You can make it dynamic. Remember, you're passing a table to startPoll and your function is still wrong. Local variable is only accessible in its code block (inside where it was defined), you seem to define 2 "found" variables and the first one will always be true, the if statement checks the first one, can you see what you did wrong?(you found it yourself) -- here is a function which will change your votedata table to contain maps and return it function giveMeRandomMapsToMyTable( tab, mapsCount ) local compatibleMaps = exports.mapmanager:getMapsCompatibleWithGamemode(exports.mapmanager:getRunningGamemode ()) if #compatibleMaps >= mapsCount then for i = 1, mapsCount then local rndMap = getResourceName( compatibleMaps[ math.random( #compatibleMaps ) ] ); local found = false; repeat -- check if the rndMap is already on the list for j = 1, mapsCount do if tab[ j ][ 1 ] and tab[ j ][ 1 ] == rndMap then found = true; rndMap = compatibleMaps[ math.random( #compatibleMaps ) ]; break; end end until found == false; tab[ i ] = { rndMap, "say", root, "Random map #" .. tostring( i ) .. ": ".. rndMap }; end return tab; end outputDebugString( "Not enough compatible maps! (mapsCount="..tostring( mapsCount ) .."; compatible maps: "..tostring( #compatibleMaps ) ..")" ); return false; end -- here is the table with settings of your poll that you'll pass to startPoll local votedata = { title="Choose a map do change to..", percentage=75, timeout=30, allowchange=false, maxnominations=3, visibleTo=getRootElement() } votedata = giveMeRandomMapsToMyTable( votedata, 3 ) -- give me 3 random maps -- votedata[ 1 ] will have an option table I haven't tested it and wrote it here so there might be simple mistakes. If this won't work just speak up. Why don't you try voteBetweenMaps? It'd be what you want and much easier. https://wiki.multitheftauto.com/wiki/Res ... otemanager
  3. In the server console type: info pool and then info mysql tell us what messages you get.
  4. Hey mate, I got it a few seconds after, was a mistake x) But still is not working... It enters on a infinite loop, i guess on getTable() function Cant understand why, can u help me ? It's simple, never use while loops if you don't know how to make them stop. In your case, "found" will always be false unless stringOfMap is in tableOfMaps. You can't just call a function and pass a table inside a table to the startPoll like you're doing because a list of the options will be a table (in your case) but startPoll only needs 1 table and its values at [1], [2], etc. are the vote options. Anyway, if you want to start any of 3 random maps then use you could use voteBetweenMaps function instead.
  5. Doesn't make sense. Think about MTA functions which are good. Check the meaning of "deprecated". @JR10, I haven't heard of such script but once you find it and it's available to public, please share it here so others could use it.
  6. Don't you know how to do "for" loops? You can't call a table, you need to iterate through table with ipairs or pairs: for a,v in ipairs( tableOfMaps ) do
  7. No but you could make a function to check them. Since the functions are still present you would have to create a table with the list of functions then check if a function is in that table. If the functions were removed from MTA you could simply check "if not getClientName then" but the functions still exist.
  8. You can do a lot of things with shaders. There is no need for caps.
  9. That's because it's race that starts them resources. Open: /race/meta.xml and scroll down to settings, find this: <setting name="#addons" value="race_toptimes,race_traffic_sensor" accept="*" desc="List of race addon resources to load automatically" /> Simply, remove the addons from there. If you want to disable killmessages then it's right on top of the file: remove this line and you'll be fine.
  10. Have you tried it? If you haven't tried it then what do you think is your next step?
  11. Thanks for the information. Sorry for misleading comment, I meant client but said server (don't ask me how did that happen, was probably too tired). I'll make a note of updater too. VB? I hope you're joking.. Well, VB is for beginners and for people who want to speak with computer (Dim a as Integer? why not simply: int a?) If you want to help, you could update the functions list (.xml files) or make a simple application to get all the functions from the wiki page and update the files itself.
  12. The bug reporter won't work for a bit so thanks for posting here. The problem with what you suggested is that you can't run other versions of the client. I have 4 different versions of MTA installed, using link form (mtasa://) would run the latest one installed which is not what I wanted. I haven't got a clue why it cannot find the files if MTA structure is the same on every machine.. I understand that resources aren't all in the "resources/" folder so I have to pay more attention to it but "MTA Server.exe" is in the same place for everyone unless you moved it to bug MTA:SE. How did you manage to get this crash?
  13. Well, it works fine because I changed the texture name from "tshirtwhite" to "shad_ped" (shadow ped) and it replaced player's shadow with the texture of new tshit and I didn't get any error/warning message.
  14. Erm... that doesn't help... that just lags your server. How can this lag your server if setElementModel will return true when the model has been changed? Just for your information there is only a few skin IDs which don't work and the chance that these IDs will be picked 1000 of times one after another is ridiculously low, well, almost impossible. Besides, this line is from "play" which comes with MTA. Do you think MTA would include a gamemode which lags your server?
  15. I checked your meta.xml. It's a long file containing only a few client-side script. If you want to steal someone's script then do it but we're not here to help you steal. If the resource is not available publicly then it's not to be used on your server. For such big gamemode like this you will need long server-side scripts which you're not going to write due to your current skills set. Learn Lua and make your own gamemode. Lets face it, if we'll help you fix this error you will come here again asking to fix another error because there will be more events triggered and more server-side scripts and lots of lines of code. If you downloaded a resource it should have meta.xml if it doesn't have a meta.xml then either you have only client-side scripts/files (which you download when joining server which runs this gamemode) or author has forgotten to put it inside .zip (which is very not likely to be the case).
  16. 50p

    Gui

    Create an image in any image processing tool (GIMP, Photoshop, Flash, etc.) then show the image in game using guiCreateStaticImage. The element returned from guiCreateStaticImage can then be used as a parent element for labels, buttons, etc. This is just a simple example: windowIMG = guiCreateStaticImage( 10, 300, 200, 150, "windowimage.png", false ); guiCreateLabel( 30, 20, 100, 20, "LABEL", false, windowIMG ); -- this label will be drawn on top of the image and will move with the image if you change its position
  17. Might be, I'm not a shader pro and haven't seen many shader error messages. What MTA version are you using? Maybe it's your graphics card fault but you seem to run high resolution so the card isn't old.
  18. If you get an error about technique that's propably because you saved the shader file with UTF-8 encoding. Save it with ASCI encoding and you'll be fine. This is my simple test resource: http://www.filefactory.com/file/ku2j1or ... re_rep_zip
  19. Read on relative parameter of guiCreateStaticImage.
  20. The bottom code needs to go to a script file (.lua), the top one needs to go to shader file (.fx). Both of these files need to be inside a resource folder and added to meta.xml. EDIT: I've just tested it and unfortunately it doesn't seem to support ped textures (any ped texture, not just clothes).
  21. It's not that I have a deadline to meet. It's just live being busier than ever. Working hard (physically), long hours, a lot of overtime, working at the weekends, decorating house, etc. There are other things than just programming/scripting. Life is getting shorter and list of things to program during my life-time is getting longer and longer. Ideas come from nowhere, some of them survive and some of them just die out and don't get to the to-do list. That's all.
  22. 50p

    color problem

    I don't see you using any colour coded function.. AFAIK, dxText doesn't support colour coded strings but you can easily modify it to work fine. You can use dxDrawText or the function you included in your script dxDrawColorText.
×
×
  • Create New...