Jump to content

unknooooown

Members
  • Posts

    259
  • Joined

  • Last visited

Everything posted by unknooooown

  1. @ ^Dev-PoinT^ I could give you the answer.. But I wont.. But I am gonna tell you this, as a hint: Remember that you should always close, function, if, for. Example: function something() if(something == something)then for i,k in ipairs(something)do --something end elseif(something == somethingElse)then --something else end end If that doesn't help you, then you should really start reading the Wiki from the beginning again. I know that scripting can be hard when you are learning.. ( I started 6 months ago, so I know ) But you also need to learn how to solve problems on your own. Good luck EDIT: Also, as -=I Blaawee I=- said: It should be "elseif" not "else if". I would really recommend that you start reading everything you can on the wiki and the Lua documentation. You have some basic understanding of how scripting for Mta works, but it seems that you have no idea how Lua works. Do some reading and you will get better over time
  2. http://i.imgur.com/GJF9a.jpg Hi. As you can see in the picture above, I have some problems with my screen atm. This only happens when I enter Cluckin' Bell, in dimension 9. (9,364.8388671875,-9.1259765625,1001.8515625) It happens when I am inside the interior and tab out of the game. I have never experienced this problem before.. But I want to hear if you guys have a solution for the problem, before I start making my own interiors. Thanks. EDIT: After testing it a few times, I have noticed that the texture/overlay that is added to the screen, when this happens, is a part of the skin texture of the current playerskin I am using. But still.. I have no idea why this is happening. EDIT2: Got a link from IRC: http://bugs.mtasa.com/view.php?id=4647
  3. Hi. I dont know if this is the right place to post my topic, but I hope that some of you guys can help me with this problem. When I use a png file as a hud element, there are some white lines around the edges of the image. (Only when used ingame) From what Google can tell me, this is a pretty common issue, but I cant find a accurate solution for my problem anywhere. Is this something that any of you have experienced before? Here is an example of the problem (See where the arrows are pointing) http://imageshack.us/photo/my-images/820/safasfg.png/ Thanks.
  4. Yeah, I did use tonumber() tostring() was a mistype in here Thank you for the help.
  5. Lol.. Nvm.. I solved the problem giveWeapon(source,tostring(table1[item1]),1)
  6. Rewrote my exapmle. This is what I mean: -v- Server Side table1 = { ["DesertEagle"] = 24 } function getInfo(blah1) local item1 = blah1 giveWeapon(source,table1[item1],1) end addEvent("whenTriggeredClientSide",true) addEventHandler("whenTriggeredClientSide",getRootElement(),getInfo) function setInfo() local client = getLocalPlayer() local blah1 = "DesertEagle" triggerServerEvent(whenTriggeredClientSide,client,blah1) end
  7. Thank you for the reply Snake. I have also tried that, but it didnt work My example was a bit stupid, because I am actually using it like this in my script:- giveWeapon(source, table1[item1], 1) -But ofc still with the same basic build as my example. Dont know if it makes a difference when I use it in the giveWeapon function?
  8. Hi. Quick question. If I have a table called "table1" and something inside the table called "LoremIpsum" - Is there some way I can get that table, not by using "table1.LoremIpsum", but get the last word, in this case LoremIpsum, from another place? Like otherPlace = "LoremIpsum" and then use table1.otherPlace ? Here is a small example: Note, that this is how I am trying to do it now, and ofc, its not working as I want it to Server Side: table1 = { ["LoremIpsum"] = 1 } function getInfo(blah1) local item1 = blah1 outputChatBox("Output: "..table1.item1) -- If it works like I want it to, this should output "1" end addEvent("whenTriggeredClientSide",true) addEventHandler("whenTriggeredClientSide",getRootElement(),getInfo) Client Side: function setInfo() local client = getLocalPlayer() local blah1 = "LoremIpsum" triggerServerEvent(whenTriggeredClientSide,client,blah1) end Note, this is just a small example I made to show what I mean. Dont care about "That wouldnt work!".. The script is just to explain myself better Hope someone here can help me. Sorry if the question is a bit confusing
  9. Ty again. I already tried the exact same thing. I have been trying to make it work for about 2 hours now. I will only be using pHealth in func2, but it returns false when I do it like above.
  10. Thank you for the quick reply. Have a look at the code again. I am adding the key pHealth and a value to pHealth in the first function. In the second function I am trying to retrieve the value again, using getElementData. I have done it the exact same way in a serverside script, where it works.
  11. Hi. Got a small problem with some code on my clientside script. Here is an example of my problem. If I try to output the line in func2, it returns false, but if I try to output it in the first function, it works. What am I doing wrong here? EDIT: Oh right.. The (message) is from serverside. function func1(message) local pHealth = message setElementData ( getLocalPlayer(), "pHealth", pHealth, true ) end function func2() local pHealth = tostring(getElementData(getLocalPlayer(),"pHealth")) end Thank you.
  12. The way you do it, its just gonna run all the values on the serverside isnt it? What I want is some way to get the data from the database, and use it for something like eg. Gui on the clientside.
  13. Could you show me an example of how you would do it? You dont need to show me a full working script, just enough to give me an idea of how you would do it.
  14. Hi. The title of the topic pretty much expalins what my question is. But what I want to know is, how can I call values from my SQLiteDatabase, in a clientside script? I'm sure its possible to do somehow, but I would like to see an example or have someone explain to me how it works. Thank you.
  15. Thank you for the try. Still returns a nil value and gives me a bad argument @ executeSQLUpdate.
  16. Didn't change anything :\ Do you think it has something to do with the way I have written line 17 or 18? executeSQLUpdate ( "playerStats", "playerHealth = 'fetchPlayerHealth', playerArmor = 'fetchPlayerArmor', playerMoney = 'fetchPlayerMoney', "playerName = '" .. sourcename .. "'" ) result = executeSQLSelect ( "playerStats", "playerHealth, playerArmor, playerMoney, playerName" )
  17. Hi. Got a small problem here, its probably not a big deal, but I hope you can help me with it When I run the script I get a nil value in return on line 19. Cant figure out why. Script: http://pastebin.com/MwEU2Mcf Thanks.
  18. Aahh. Okay. I see. Thats seems to be a lot easier than I thougth I will try it out asap
  19. Hmm.. I was just thinking. To make the tail work as it should, I need to set each new ped to follow the ped created before it. But doesnt that just take us straight back to the table? I mean, at this point there is really no control of the tail, other than that its attached to the player. But it doesnt respond very well to the mouse yet. I have been thinking and drawing on a piece of paper how I would be able to make it, but I always end up at the table Hope you understand
  20. Haha.. Dont worry I'm gonna be working more with the script for a few hours before I go to bed. I will post it here when I finish, if you guys still are keen on helping me
  21. You think it will be possible to make the tail move like so: When the player moves ofc.. .. Check out the Paint skillz.. http://imageshack.us/photo/my-images/600/etyju.png Edit.. Just forget about that.. That image can be misinterpreted in so many ways. Its hard to explain what I am thinking atm
  22. LOL! You are amazing Jacob! I love how you guys struggle to make my project work.. But hey, I am learning something here.. Have a feeling this topic will be a lot longer than it already is
  23. Sounds great It has to be possible to make the script work. I have always heard that nothing is impossible when it comes to scripting
×
×
  • Create New...