Lordy

Members
  • Content Count

    290
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Lordy

  • Rank
    Pee-Wee

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Lordy

    Editing CEGUI colors

    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. Lordy

    Global tables

    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. Lordy

    dx players list

    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.