Jump to content


  • Posts

  • Joined

  • Last visited

1 Follower

About tosfera

  • Birthday 20/03/1995


  • Gang
    Advanced Gaming
  • Location
    The Netherlands
  • Occupation
    Lua scripter, web developer, game developer and scripter.
  • Interests
    PHP, SQL, Lua, c++, asp.net, c#, Java. Game, Web, Android and windows platform.

Recent Profile Visitors

2,060 profile views

tosfera's Achievements


Banger (36/54)



  1. And after that you'll isolate again? Great strategy, kid.
  2. Worst idea ever, adding a whitelist to your server. You'll never grow like that.
  3. If I'm looping through the saveData, it's already returning 6 things. which is actually incorrect since it should return 3 collections. Looping through the saveData like this also returns the wrong collection: for i, p in ipairs ( saveData ) do outputChatBox ( i .."--".. tostring ( p ) ); end I'll just do it the ugly way since the function isn't going deep enough.
  4. Alright, I've got the following JSON saved in my mysql: [ [ { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 } ], [ { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 } ] , [ { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 }, { "lastPlayed": 0, "experience": 0, "money": 20 } ] ] It are 6 elements inside 3 elements. Each of these 3 elements holds 6x the { "lastPlayed": 0, "experience": 0, "money": 20 }. Whenever I'm using fromJSON, it's returning the wrong information when I'm trying to access the first element out of the second collection. The code I'm using is as following: local saveData = fromJSON ( data [ 1 ].saves ); outputChatBox ( #saveData ); -- returns 6 elements (incorrect) outputChatBox ( #saveData [ 2 ] ); -- returns 3 properties (correct) outputChatBox ( tostring ( saveData [ 2 ] [ 1 ] ) ); -- returns nil The JSON is valid, I can use it in different languages too and every parser says it's correct. I'm starting to think that fromJSON is returning just the first collection instead of all 3. Has anyone encountered this problem? I'm not really a fan of putting it all into 1 collection, it's preventing me from adding more and more data later on.
  5. A wise psychologist once said: I would rather fix the problem at the roots, instead of trying to fix the symptoms.
  6. As I said, turn on debugscript 3 to read the errors. If you really can't work it out then I can, but you have to try it yourself first. We're not just giving things away without you even trying.
  7. First of all, in your server's side: local text = guiGetText(Edit) 'Edit' is nothing, you haven't declared it anywhere. Second of all, in your server's side you're expecting a playersource as first variable which you called 'plr'. In your client side, you're sending a function: triggerServerEvent( "myEvent", localPlayer, guiGetText ) If you would've put on debugscript 3, you would've gotten an error. Go to your server, turn on /debugscript 3 and read the errors.
  8. guiCreateBrowser should be used for interactive websites, where people can use the website theirself. If you still want to have the dxRender for your browser then simply draw the render over the guiCreateBrowser. the browser will do the functionality while the render does the overlay of it. No idea why you would want that but oh well, you never know!
  9. Neither does your input or hover work because you've used CreateBrowser which the wiki states as, and highlighted the part which is your problem: You're looking for input-handled functions, which can be done with GuiCreateBrowser. This would do: local browser = guiCreateBrowser ( ( x / 2 ) - 200, ( y / 2 ) - 100, x, y, true, true, false ); local theBrowser = guiGetBrowser ( browser ); addEventHandler ( "onClientBrowserCreated", theBrowser, function () loadBrowserURL ( source, "http://mta/local/login.html" ); end ); Also, you know that you can position the div with css itself and create the browser with '0, 0, x, y'. right? simply add this to your body element as a class: top: calc(50% - 100px); left: calc(50% - 200px); position: absolute;
  10. If you think about it.. it's actually quite easy to do pathfinding. You got the GPS resource which has all the nodes, if you simply modify the distances it stays away from nodes, you got the basics laid out. Then simply create a colshape around the player to see if there are any objects in their way. if so, move around them. it would be pretty hard to do since turns will mix them up, but if you're really interested in getting a basic pathfinding.. that would be the way to get started.
  11. What do you mean with 'naturally', do you want the player to walk there or rather want it to teleport there?
  12. Ya I assume it's a bug in MTA because this has been killing me slowly. guess I'll see what they do with the reports.
  13. Can't edit my post, what a joke. So that'll be a double post.. anyway, unbinding the entire key doesn't work. Any chance you got another idea?
  14. What he's trying to say is that you could turn off the cache from your client sided files in your meta.xml. This will prevent the system keeping the files on your computer. Another thing you can do is compile your scripts, they won't be able to change anything in them. If you really want to give them a pain in the ass; create a function/trigger to the server, on the server's side check for an IP. if that ip mismatches, stop the entire functionality of the entire script. Simply break the functions everywhere. They can change this theirself too if they got the server sided files, for that.. you can't protect yourself. just make sure no one has access to your files.
  15. You're almost trying to kill the client there, seriously.. don't work like that. Better use these steps; player logs in/joins the server set their data (their acl group OR a default group), something like: 'rank' in the onClientRender, loop through the players, get their rank once you got their rank, get the correct render name (make it an array/table and read it from there for ease) you're done.
  • Create New...