Jump to content

Addlibs

Members
  • Posts

    1,060
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Addlibs

  1. hide_hideGUI = hide.hideGUI --You've set hide_hideGUI equal to hide.hideGUI (nil). Since hide.hideGUI is not defined yet, it's equal to nil; thus hide_hideGUI is also equal to nil. function hideGUI(regged) --Function name is no longer 'hide.hideGUI' (not in the 'hide' table) - No point of trying the suggestions if you chose to make the function outside the table. All above suggestions are ways to use exports on functions which are within tables. exports.CORchar:hide_hideGUI() --Trying to call a function that isn't defined. Only hideGUI is defined, not hide.hideGUI. Moreover, neither hide.hideGUI, hide_hideGUI or hideGUI were defined server side.
  2. That 'full code' clearly shows you're not a newbie in scripting, but whatever... btnClose = guiCreateButton(28, 385, 115, 20, "Close", true ) addEventHandler ( "onClientGUIClick", btnClose, function ( ) guiSetVisible (MainWindow, not guiGetVisible ( MainWindow ) ) end )
  3. 1) You've changed the function name, you no longer store it in a table so I don't know why you're trying the suggestions above since they're no longer relevant to your case. 2) Exports from client side cannot be called server side, nor vice versa. 3) You need to define the alias AFTER defining the function.
  4. Try using HTML numeral entities with in the database, in conjunction with the following function to unescape it: function unescape(str) str = string.gsub( str, '<', '<' ) str = string.gsub( str, '>', '>' ) str = string.gsub( str, '"', '"' ) str = string.gsub( str, ''', "'" ) str = string.gsub( str, '(%d+);', function(n) return string.char(n) end ) str = string.gsub( str, '(%d+);', function(n) return string.char(tonumber(n,16)) end ) str = string.gsub( str, '&', '&' ) -- Be sure to do this after all others return str end --Source: [url=http://stackoverflow.com/questions/14899734/unescape-numeric-xml-entities-with-lua]http://stackoverflow.com/questions/1489 ... s-with-lua[/url]
  5. You'd have to modify the scoreboard resource for this.
  6. Start off by getting the edit box's input via guiGetText(edit) triggerServerEvent("onClientProceedToRecover", localPlayer, guiGetText(edit))
  7. Addlibs

    Telewire

    @MrBrutus; Have you seen any telephone wires in the range of 10,000m from (0, 0, 0)? Well, there are plenty of them since 10,000m covers more than the size of the whole map. @Xabache; I have no idea why that does does not work, but it could possibly be a streaming thing... Try to head away from the map when running the code and then return to some place to re-load the GTA world
  8. You need to stop the serer before editing the ACL manually, and then start it up again. I have never actually checked but I believe aclReload might resolve your issue - try it in runcode
  9. You want to add a record only if there isn't one for that specific nick already? query: SELECT * FROM data_system WHERE nick = ? if #result == 0 then execute: INSERT INTO data_system (nick, ??, ??, ??) VALUES(?, ?, ?, ?) end
  10. addEvent("glock19e", true) function glock19() outputChatBox(money) local money = getPlayerMoney(client) if money >=2 then giveWeapon( client, 22, 1, true) outputChatBox(money) else outputChatBox(money) end end addEventHandler("glock19e", getRootElement(), glock19) Ps. Use proper thread title next time.
  11. Addlibs

    help shader

    Open up /debugscript 3 and restart the script. Any messages there?
  12. Too bad you didn't include that line, or edited the apparent error message, since it looks like it originates from line 28, not 46.http://www.lua.org/manual/5.1/manual.ht ... math.atan2 math.atan2 has two arguments, not just one. math.atan2 ((copx - prisonerx) / (copy - prisonery)) --extract of line 28
  13. I'm not good at metatables and custom OOP, so I cannot really help, but I think this might be the problem: Is self defined within the self.renderFunc on line 66? Line 66: self.renderFunc = function() self:Render() end; --is self defined within this function?
  14. xmlNodeGetChildren and then xmlNodeSetAttribute
  15. getTimerDetails returns how much time is left - when the resource stops, you could store all these values somewhere (preferably in a database) and when the resource starts, check if the values exist, if yes, set timers for that time, else, set for another 24 hours.
  16. You could just as well go and collect the LOD model ids from the map editor and also store it under another database column or XML attribute
  17. function getCartTotalCost(cart) local totalCost = 0 for k, v in pairs(cart) do --used pairs, in case the keys/indices aren't in order totalCost = totalCost + prices[v.weapon] --update the last bit according to your script end return totalCost end Ps. why do you use element data to store the chosen weapon? Wouldn't it be easier to make it a variable?
  18. getElementData(player, "admin.level") returns a value that does not represent a number (or a number within a string), therefore tonumber returns nil, and you're attempting to see if 'nil' is greater than 1.
  19. What is the actual problem? What isn't working? Any /debugscript 3 errors?
  20. Start from the highest and go down to lowest. Lua executes the first matching if statement - if the >100 returns true, that code is executed and rest is ignored.
  21. try if tonumber(distance) >= 100 then
  22. Disable the original sounds with setWorldSoundEnabled and then make a client side check (setTimer or onClientRender in conjunction with getTickCount), if getVehicleSirensOn returns true, playSound3D. As soon as it stops returning true, stopSound or destroyElement PS. This was already suggested (not in as much detail) in another topic - use the search first next time viewtopic.php?f=91&t=85516
  23. Addlibs

    INV Sys

    Then just use the simple way. SELECT * FROM envanter WHERE accountname = ? AND itemname = ? if #result >= 1 then UPDATE envanter SET something = ?, something_else = ? WHERE accountname = ? AND itemname = ? else INSERT INTO envanter (something, something_else, accountname, itemname) VALUES(?, ?, ?, ?) end Change accordingly to what you actually need to insert/update.
  24. Set download="false" on files in the meta.xml of a resource (such as mods) and then download them through downloadFile when needed.
×
×
  • Create New...