Jump to content

'LinKin

Members
  • Posts

    636
  • Joined

  • Last visited

Everything posted by 'LinKin

  1. Hello guys, When you try to do addEventHandler("name", root, function), if you already did this before, you'll get an error in the debugscript. Something like: added event with this function already handled. My question is, how can I check if that event was already added? Thanks.
  2. No I haven't. ----- I was getting this error: http://s7.postimg.org/s5vwgckvf/errir.png So, I tried the options: Abort, Retry, Retry (skipping questions) and ignore. But with every option I was getting back to this error, it was an endless cycle.. I didn't know how to quit this so I had to close the program (I use PuTTy). Then, I readed something telling me that I had to have LAMP installed, so I followed the stepts to install it and it was a sucess. Then, when I typed sudo apt-get purge phpmyadmin to uninstall PhpMyAdmin it showed this error: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? Then, I killed the proccess with apt word with this: ps aux | grep apt kill -9 processnumber And the processes were stopped. Then I tried back: sudo apt-get purge phpmyadmin But still getting the error: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? This is the task manager (I deleted the processes that I know have nothing to do with this trouble) http://s23.postimg.org/jinp5y1sr/TOP.png
  3. Hello, Guys I need to have a MySQL database which accept EXTERNAL connections. I was told I could do this because I've a VPS. But the thing is, I don't know how to use it! I've installed mysql client & server. (Ubuntu 12.04 64bits). And I've installed succesfully, but what now? How to create a database? How to change the settings so that it accepts external connections? Can anyone be so kind and help me out with this? Thanks, Linkin.
  4. No. Anyway, I've already done it. Just use this code: if ( forceShowing ) then cover = guiCreateButton ( 0, 0, 1, 1, "", true ) guiSetAlpha ( cover, 0 ) addEventHandler ( "onClientGUIClick", cover, bringMsgBoxToFront ) end And some logic
  5. Sorry mate, but that's not what I'm looking for / asking for
  6. Hello, For example if I type 'p' the admin panel opens, if I type 't' the chatbox starts to accept input, and the same with some other keys/binds How can I disable the binds when I'm typing something inside an edit box? Thanks.
  7. Hello, I want to insert some values to a table, one of these values must be typed by the client first. Here's the idea: for i = 1, 5, 1 do table.insert(someTable, {idx = i, text = myFunction()}) end function myFunction() --I'd create an editBox in a window here, and a button "OK" addEventHandler("onClientGUIClick", aButton, doClick, false) end function doClick() return guiGetText(anEditBox) end That's wrong, but that's the idea of what I want to do. How can I make the for loop not move to the next iteration but only untill the player clicks the OK button in a window?
  8. Hello, Do you know what a modal dialog is? - In Java, a modal dialog is the one which does't allow the user to click on the windows form the back. I want to do this with MTA GUI. I was taking a look at this resource: msgbox. But sadly, that only makes a confirm dialog, and that's not what I need. I need to display a window where the client inputs some text. In msgbox resource, there's something called forceShowing which is making the window behave like a modal dialog. But there's something that I don't understand... How is it working? I got this piece of code: if ( forceShowing ) then cover = guiCreateButton ( 0, 0, 1, 1, "", true ) guiSetAlpha ( cover, 0 ) addEventHandler ( "onClientGUIClick", cover, bringMsgBoxToFront ) end Is that button occuping the whole screen?
  9. Hello, I remember that when I was making maps, it was possible to move an object very slowly. (Alt+PageUp) For example. That was several years ago. And since then I hadn't touched Map editor untill now. But I'm facing a problem now, that slow movement is gone! And it's due to MTA version. I'm working on a map for Destruction Derby gamemode, so I do need this slow movement so that I can make the nessesary adjustes to the roads so that they aren't flickering. How can I make this? PS: I already know I can edit the Z pos with F3, but that really slows down the proccess.. EDIT: I went to Options - General > And unchecked the checkbox "Precise Position". It works as I wanted now.
  10. 'LinKin

    setRuleValue

    Hello, Today I found this on the Wiki: setRuleValue I made a fast test to see how it worked but I still don't understand what it does. What is it for? Explained in a friendly way
  11. 'LinKin

    dcConnect

    Hi, I found an open source script. And I found these two lines where it connects to the database local con = dbConnect("sqlite", "db/donate.db") dbExec(con, "CREATE TABLE IF NOT EXISTS donators (account TEXT, time TEXT)") I've not tested it nor I want, but I am curious about the way he's doing that. I'm wondering, what if the file donate.db doesn't exist? Does the script creates it automatically? Thanks.
  12. executeSQLQuery("DROP TABLE IF EXISTS `tableName`")
  13. It's a bug... The code is ok. I'm even doing this check: if guiGetVisible(g_Window.window) then outputChatBox("Visible") guiSetEnabled(g_Window.window, true) end And it outputs "Visible" in the chat.. Also, cursor is shown, but the window is not visible.
  14. I don't think so.. If the setting is false before the resource start, it will work good. But if I change it to false while the resource is running, it get's bugged.. This doesn't happen when I set it to true.. I can change from false to true with no problems. The following inside onSettingChange SERVER animateWindow = toBoolean(fromJSON(newValue)) triggerClientEvent(root, "onServerUpdateAnimation", root, animateWindow) CLIENT addEvent("onServerUpdateAnimation", true) addEventHandler("onServerUpdateAnimation", root, function(isAnimated) animateWindow = isAnimated end) I don't think there's a mistake in the code.. I used with outputChatBox to check if the script was getting into some if conditions.. It's working fine... I think it's a bug..
  15. Hello, I've an odd bug right here.. Let me explain; I have a setting (Animate Window on Open/Close) by default is 'false' So it won't animate the window if it's 'false'. When, I start the resource and press the key to toggle my window visible/not visible, it opens/closes normally, without animation. All good so far. Then, I go to the admin panel and I change the Animation setting to 'true'. Then, I press the key to toggle my window visible/not visible, it opens/closes normally, with animation this time. All good untill this point But then, I go back to the admin panel and I change the Animation setting back to 'false'. Then, I press the key to toggle my window visible/not visible, BUT, it doesn't get visible! It shows the cursor, but the window is not visible.. I verified if the window was getting it's visibility changed by this line: outputChatBox(tostring(guiSetVisible(g_Window.window, not isVisible))) And it returns true.. But the window is not visible.. I must restart the resource and then press the key so that it works.
  16. Well ok I made this: It seems to work function isStringHexCode(theHex) local Hex = theHex:gsub("#", "") if #Hex == 6 and tonumber(Hex, 16) then return true end return false end I got another question, How can I check if the first character of the string is "#" or not?
  17. Hello, I want to check it a string is a color code or not. I tried with string.match but it's not precise.. It's like using string.find. So if I have; local theString = "#FF0000Test" string.find(theString, "#%x%x%x%x%x%x") will return true, but it's not since the string contains the 'extension' (Test) I tried if theString == "#%x%x%x%x%x%x" then ... But it didn't work either.. function isHexCode(theString) --Which condition to put here? end Thanks.
  18. Hello, I've a table, the key is a team's element, for example: team1 = getTeamFromName("ss") team2 = getTeamFromName("aa") team3 = getTeamFromName("dd") teamsTable[team1] = { name = "mmm", tag = "tag"} teamsTable[team2] = { name = "mmm", tag = "tag"} teamsTable[team3] = { name = "mmm", tag = "tag"} Then I use a for loop (in pairs) because (in ipairs) doesn't work. But working with in pairs loop generates an 'unorganized' functionallity. So for example I got this: for _, theTeam in pairs(teamsTable) do outputChatBox(tostring(_).." Team: "..theTeam.name) end It will display the teams without order, in this case it showed the teams in this order: team3 team1 team2 I want to make it in the same order as I "insterted" the teams in the table.. Can I do this by working with an element-key table? Or I am oblied to use an indexed table? Like table.instert(teamsTable, {name="ss", etc...} ) Thanks
  19. I searched Server and Client files of the Admin resource. I didn't find the line where it sends the message to the server. Hmm.. But I found something, I found this event like this: addEvent("onSettingChange", false) addEventHandler("onSettingChange", root, function(name, oldvalue, value, playeradmin) cache() end) It's plassing a 4th argument
  20. Searched in the whole admin resource. Didn't find the line where it displays this message
  21. I wonder how the message "Set 'inkcw.changeMapTime' to '123'" is only displayed to the player who changes the setting.. :\
  22. Hi, When using onSettingChange event. Is it possible to pass as an argument, the player who changes the setting? I remember I saw this somewhere as an example, they were passing these arguments to the function: function(theSetting, oldValue, newValue, thePlayer) I've tested but thePlayer is nil.. Also, When a setting gets changed it displays in the chatbox a message. Ex: Set 'inkcw.changeMapTime' to '123' How is this message displayed only to the player who changes the setting? Thanks.
  23. Hello, Have you ever seen the projectiles shot by Hydra? You can aim the target u want to shoot. And the misile will follow it. I want to do that but with cars, is that possible? I've seen createProjectile has an optional argument target: element target used for heat seeking rockets. I've created this once and the target element was a player that I took via getPlayerFromName, but that's not what I want. I want the Hydra's aiming and target-locking effect. Thanks
×
×
  • Create New...