Jump to content

WorthlessCynomys

Members
  • Posts

    369
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by WorthlessCynomys

  1. Well. Okay... I'm not at a PC to test it and It is good with the syntax as I see, so I'm sorry, I can't help you now.
  2. setPlayerHudComponentVisible() showChat()
  3. local users = { ["layla"] = 5, } addEventHandler("onServerPlayerLogin", root, function() local name = exports.serverCore:getPlayerAccountName(source) if (users[name]) then setElementData(source,"premium", users[name], true) end end) This should work. It might be the same as yours now, but maybe you did something wrong. With this if you registered with the username layla, it should work.
  4. You miss a space between the equation sign and the name of the variable. That should be the problem.
  5. You can do that too with what I recommended.
  6. You can use dxDrawImage and a PNG image that has a circle in it and a transparent background. That'll do for now.
  7. That's not what he needs. The other thing you can do is that you use an image as the frame.
  8. I'd wait for the next version of MTA where dxDrawCircle will come in. With that, easily. Now you can use dxLines to draw a circle. Now that uses a looot of dxLines, therefor using huge amounts of resources.
  9. You create a gate object with createObject, then you use command handlers that are set to restricted to move the gates. createObject addCommandHandler moveObject
  10. addCommandHandler has a restricted argument. Setting that to true and adding the permission to the group in the acl will do the thing.
  11. You can do that with these: onVehicleEnter setTimer getPlayerMoney setPlayerMoney onVehicleExit killTimer
  12. Go to the WIKI page of dbConnect. There are example lines that can be copy pasted into your code, so like if you use MySQL, then you copy paste the MySQL line, fill it out with your data and it will connect. This is how you do the connection part. Doing anything other than this is done by the other 3 functions. Selecting data from the database is done with dbQuery. You have to provide the MySQL connection to it, then write an SQL query to select the data you want. An SQL query looks somehow like this: "SELECT * FROM accounts WHERE id=?". This will select everything in accounts table where the value of id equals to what you gave to it as an argument. It looks like this: queryhandle = dbQuery(connection, "SELECT * FROM accounts WHERE id=?", id); The value of id in the query will be the value of the variable id. You can process the retrieved data with dbPoll: result = dbPoll(queryhandle, 500); This will give you a Lua table containing the lines that you got back. You can work with that table using a for cycle: for i, row in ipairs(result) do -- i stands for Index and row stands for the rows that you got back from the database. outputChatBox(row["username"]); -- This will output the username value of every line. end If you don't want any return values at an update or insert, you can use dbExec: dbExec(connection, "INSERT INTO accounts SET username=?", username); These are the very basics. MySQL isn't hard, it's just a complete mess and this makes it hard to understand. Once you feel it, it's one of the easiest things in the world :D. Good luck.
  13. .sql files are containing the databases and tables. You have to use MTA's internal database functions dbConnect() dbQuery() dbPoll() dbExec() To handle MySQL. You can connect to your database with dbConnect. There's no such function as mysqlconnect.
  14. This says that the function mysqlconnect is a not existing function. That is true. Do you use some kind of .dll or .so file to handle mysql?
  15. Okay... Your idea sure looks awesome.
  16. You can not. It is probably a development error. My guess is that knife and RPG are not included as weapons in that DayZ mod, so when you die by them the script does not react to it.
  17. You can do it with a variable, two events, an if and a table containing the colshapes and a for cycle. On the event onColShapeHit you cycle through the table containing the colShapes, check if the variable is true or false and set the so called variable to true if the player entered one of the shapes in the table, then break out of the cycle and continoue on with the planned procedures. On the leave you do the exact same thing, only you set the variable to false now.
  18. Do you have the line setElementData(player, "faction", "Police") Somewhere in your codes? In the function vh insert the line: outputChatBox(tostring(getElementData(player, "faction"))) and tell me what it outputs in the chatbox when you try to enter a police vehicle.
  19. And that is decided by element data. Do you use debugscript? Have any errors? Who can enter the vehicle now? Police can't and everyone else can?
  20. Do you set the element data of the member of the police faction? I mean I'm quite sure that element data is not the only thing determining whether someone is police or not.
  21. Do you have debugscript on 3? Do you have any error messages?
  22. I don't really understand what you are trying to say.
  23. I'm not the one who helped, but this community is about this. Feel completely free to ask about anything realted to scripting!
  24. Images = { -- You store the images here. Like: "Image.png", "Image2.png", "Image3.png", -- and so on }; local currentImage = 1; local image = guiCreateStaticImage(x, y, width, height, Images[currentImage]); addEventHandler("onClientGUIClick", root, function() if (source == theButtonElement) then currentImage = currentImage+1; guiStaticImageLoadImage(image, Images[currentImage]); end end ); This is totally basic. It won't work in this exact form, but It should give you an idea on how to do it.
×
×
  • Create New...