Jump to content

Lordy

Members
  • Posts

    290
  • Joined

  • Last visited

Everything posted by Lordy

  1. You can change it locally. C:\Program Files\MTA San Andreas\MTA\cgui\CGUI.png But if you want to change it for other users too, you need to write custom GUI (using images etc.) There *could* be an option, kinda like server setting to enforce other CGUI.png on clients, but it's not possible at the moment. Search in bugs.mtasa.com if there is such issue, if not, create it The main way to suggest features.
  2. The problem that I pointed out is still there.. he's doing .sqrt(blah) local variable = math. which is really weird, as it should be local variable = math.sqrt(blah)
  3. You did switch line numbers off before copying, right? Or didn't you? @Solidsnake, it's hard to read the code with such indenting..
  4. I don't see them either anymore. Can't say I miss them though
  5. What is the point of posting a complete script which he can just blindly copy-paste and then ask for a new one, instead of spending some time to answer his problems so next time he wouldn't have to ask anymore.
  6. Well how much data is lots of data? And if it's really optimised code, you should maybe break the loops up I'm not sure if this would work, but worth a try imo local n = 1 local steps = 20 for n,n+steps do --whatever you do n = n + steps end for n,n+steps do n = n+steps end etc. so it would effectively do the whole loop but would be several loops so it wouldn't time out
  7. Doesn't matter if he copied, you posted it into help sector But Blackvein, please DO read the whole thread http://forum.multitheftauto.com/viewtop ... 91&t=28300 . There is a working autoteam script there (from where you copied only a few lines)
  8. Lordy

    createobject

    Don't pass. It's the most basic thing with commands/even gui windows local active = false function yourFunction() if not active then -- if it isn't active yet, only then -- your code, which starts stuff active = true -- set it to active, so it couldn't get duplicated end end function yourSecondFunction() if active then -- only run, if it's active -- your code, which ends stuff here active = false -- as things have been shut down, you can now set it to inactive again end end And when you start something, you call yourFunction, when ending it, yourSecondFunction
  9. But you just did read it I presume Nah, really, I don't think that anyone cba to read it, really, but maybe someone will, and even then the post wasn't entirely useless.
  10. Interesting thread. If someone wants to have a longer read on the topic, here's one link a guy on another forum gave me (when I asked questions unhelpful way, a long time ago ) http://www.catb.org/~esr/faqs/smart-questions.html
  11. Lordy

    GUI Problem

    That's kinda logical. It's not like SAMP, where server shows client gui It has to be a client side script, not server side. Wiki states aswell that gui functions are clientside not serverside.
  12. tables work exactly like any other variable. Let's say you have a server side variable serverVar = "niceHair". It can be called from server side scripts of that resource. Same case if you had a server side table serverTable = {}. You can operate with it only server side.
  13. Or you could cache the player list in a table on resource start and every time someone joins/leaves, you modify the table, so you wouldn't have to getElementsByType("player") every frame. local players = {} -- make it local to the file, not necessary, but I like function cachePlayers() for k, v in ipairs(getElementsByType("player")) do players[k] = v end end function addPlayer() table.insert(players,source) end function removePlayer() for k,v in ipairs(players) do if v == source then table.remove(players,k) return end end end function drawList() for num,this_player in ipairs(players) do local plname = getPlayerName(this_player) dxDrawText(plname,100,100+num*16) --num increases with each cycle, so every name is drawn under previous name end end addEventHandler("onClientRender",root,drawList) addEventHandler("onClientResourceStart",resourceRoot,cachePlayers) addEventHandler("onClientPlayerJoin",root,addPlayer) -- add a player into the table when someone joins addEventHandler("onClientPlayerQuit",root,removePlayer) -- remove a player from table if he quits It's slightly more complicated but should be faster. Not much, but if you have lot's of stuff going on onClientRender, things should be optimized.
  14. When you use [] in string functions, it defines a new set http://lua-users.org/wiki/PatternsTutorial look for sets. So when using string.find(stringa,"[abc]") it returns if either a, b or c is found. In order to fix it, you need to escape [ and ]. I think they can be escaped with %[ and %] but I'm not sure.
  15. Alright, in that case I want to know your clientside script. What are you passing as root element in triggerServerEvent
  16. iirc in registry.db in server/mods/deathmatch directory
  17. Try this. Before doing the xmlLoadFile, output to chat fileExists("connect.xml") just to make sure MTA recognises the file. If it returns true, try having the xml file as <connect></connect> instead of just <connect/> Maybe it wants the root node to be like that. Also maybe it doesn't like attributes for the root node. Just see if it loads the file. These are just "maybes" which you should try. I'm not really sure what could be the problem there. EDIT: And just a tip, instead of checking, if the file is nil and if the file is false, use just if not File then end , because not nil and not false both return true
  18. http://www.ladypenelopeltd.co.uk/contact-us.html
  19. Lordy

    Flag ped?

    Are you using some online translator? It's really hard to understand what you mean.
  20. MTA has also a builtin function split for the job. http://wiki.mtasa.com/wiki/Split
  21. Lordy

    creat water

    Can't see much point in creating water outside SA map, it's all water there anyway, isn't it?
  22. You just read the whole file in for example and then split it from newlines.
  23. Alright. There's the definitions.xml file in the resource Inside that, there are two languages defined, ENG and EST You can define something else (preferable keep ENG as the first, it's essential for the resource to work). Just duplicate the ENG part and change it for example to FIN. Now translate the strings. You can always add new strings aswell, but you need to make sure that the first (ENG) has all the strings listed. The others don't have to have. The resource="rodeggo" part means that the string is meant to be called from rodeggo resource. You have to change it to any other resource you are using (or use a bit different importing) Now in a random resource, you need to define myStringArray = exports.rodeggo:importStrings() Then you can use them like outputChatBox(myStringArray.SOMESTRINGID) SOMESTRINGID is the string name in definitions.xml And when you switch languages with "/setlang ENG", "/setlang FIN" then outputChatBox should output different strings. If you want to access strings which don't belong to that resource, you need to do myStringArray = exports.rodeggo:importStrings(resourcename) resourcename is the same as in string tag resource="" in definitions.xml You can check the source of the resource as well, there should be one commented out example.
  24. No. The idea of this resource was that client could choose his/her own language and then they would be translated, not that a scripter defines in which language the current string comes.
×
×
  • Create New...