Jump to content

12p

Members
  • Posts

    2,608
  • Joined

  • Last visited

About 12p

  • Birthday 17/04/1996

Details

  • Location
    Chile
  • Interests
    Music, Videogames, Computers and People

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

12p's Achievements

Shooter

Shooter (40/54)

2

Reputation

  1. Happy Birthday MTA! So glad to have known about this project... Since about a decade now, for me! Lua was my first scripting language ever, and boy was it fun to learn. MTA Team, thank you for doing so much, and sorry for doing so little. So they say.
  2. No, I've no issues sharing it. Username is benxamix2 and my current e-mail address would be [email protected], although I'm not sure if it's associated to that account. The profile URL is https://community.multitheftauto.com/index.php?p=profile&id=237892
  3. 12p

    Call for web designers

    I'd like to help here. I have experience in web design, mostly jQuery+Bootstrap and Angular. I've been playing MTA since 2009 or so, I think. This forum has seen me grow over time, as my interest in programming, started with Lua. I moved on from MTA for some time and I've done a couple of random comebacks every once in a while. I currently have a job as an IT consultant, I've finished a technical career as a Programmer Analyst, and most of my job experience has been poured into web design and Java programming. However I haven't mounted a 'visual' portfolio of my own yet, and I'm mostly comfortable writing JavaScript/TypeScript, so if there's any open-sourced project that one can contribute to (e.g. GitHub or the like) I'd gladly put hands-work into it, being addition of features or maintenance of code. Here's my GitHub account at the very least, it's got an Angular app I wrote for my career's final grade exam. I was also the main scripter for NeoPlaygrounds back in the day, heh ?
  4. Hello. I am currently having troubles logging into my MTA Community user profile, it says 'Invalid User ID'. Could anyone help me sort this out? Thanks in advance!!
  5. so, uh, yeah, again me, please, help. thanks.
  6. https://wiki.multitheftauto.com/wiki/OOP
  7. It's quite obvious, heh. function phone:new() local data = {} --blahblahblah return data end --blahblah phone:new() "data" isn't processed anywhere outside of that function scope if you do it like that. Consider deleting the "local" prefix inside of that function block, or adding it to the last line, like: local data = phone:new() or, let that table exist outside of any block, so its scope is limited to the whole script file.
  8. I'd be glad if someone could answer me this. Thanks beforehand.
  9. Ok guys look, I've got this code: local findX, findY, findZ = getWorldFromScreenPosition(cx, cy, 60) local rlX, rlY, rlZ = getElementPosition(localVehicle) rlZ = rlZ+4 local hit, finalX, finalY, finalZ, element = processLineOfSight(rlX, rlY, rlZ, findX, findY, findZ, true, true, true, true, false, true, true, true, localVehicle, false) if not hit then finalX, finalY, finalZ = findX, findY, findZ end if element == nil or getElementType(element) ~= "player" then createProjectile(localPlayer, 19, rlX, rlY, rlZ, 0, nil, findRotation(rlY, rlZ, findY, findZ), findRotation(rlX, rlZ, findX, findZ), findRotation(rlX, rlY, findX, findY), (findX-rlX)/60, (findY-rlY)/60, (findZ-rlZ)/60) else createProjectile(localPlayer, 20, rlX, rlY, rlZ, 1, element) end It's supposed to launch a rocket directed to the center of the screen. It works flawlessly if pointing to N or S. Otherwise, it's working, but said rockets detour after some travelled distance, which I believe to be caused by the rotation, but I really can't tell how to fix it... Maybe I'm using findRotation wrong? I've also tried setting all rotation axis' to 0, but it didn't help. Can someone help me with this? It has nothing to do with beforehand values, I've already debugged everything, and the problem is only there in the createProjectile function.
  10. local polveh = getElementsByType("vehicle") I'm gonna help you to understand how to use this. So, you want it to be triggered for every police vehicle? I guess you mean you mean to every player who is in a police vehicle. That isn't possible from client-side, unless you want to add unnecesary extra processing both for client and server by triggering events from client and back from server. So, in the server script is where we'll use some of that code you have there. You gotta paste the following in the part where you trigger the client event. Use your common sense to know if there's something to replace, remove, or add; I'm only explaining how to do this particular stuff work, NOT how to make it compatible to your whole code: local polveh = getElementsByType("vehicle") for i, v in ipairs (polveh) do --Let's loop through every policecar if getElementData(polveh,"Service") == "Police" then --I hope the car itself has this element data, not the player pl = getVehicleOccupant(polveh) --Let's only retrieve the player who's the driver of a policecar (it isn't a good idea to trigger the event more than once per car) triggerClientEvent(root, "policeradio", pl) --trigger that client event to EVERY player that exists (hence that "root") end end --This "for" loop will be done for every single policecar, remember that! Now, for the client-side: addEvent("policeradio", true) addEventHandler("policeradio", root, function() local x, y, z = getElementPosition( source ) local polveh = getPedOccupiedVehicle( source ) policeradio = playSound3D("policead.mp3",x,y,z, true) attachElements(polveh, policeradio) end end ) This should work. You can delete my comments (the gray text) when you paste the codes; they're only there to help you understand why and how it all works. Also, remember to eventually destroy the sound!
  11. Since compiling is only the action of transcripting a file to make it understandable in computer language (or, in this case, to simply avoid to see the source code, because it's a scripting language), there are de-compilers in the internet, built to do exactly the opposite process in order to get the source code out of a compiled file. However, there are methods to avoid that. That page you passed has two for the MTA Lua scripting language, the second one only possible to be used in 1.3.4 or later releases of the MTA client (the mod). To put it simple: if you have downloaded the latest one recently from the main page, you shouldn't have a problem using any of those two options. I can't provide much of an in-depth technical look, because I'm not into it yet. I hope my answer served you anyway.
  12. I don't understand your question. Where did you take those concepts from (e.g. maybe a forum topic, post which)? And what is, precisely, what you ask for?
  13. That error occurs when you try to insert values into non-declared tables. To fix it, either change the name of your button to something without the brackets [ ], or add this line before it: guestb = { } This is declaring a table. You can read more about tables and related at the Lua wiki. If you're familiar with arrays, it's similar but easier to use.
  14. Here, an user-friendly description. getTickCount returns a given time in miliseconds that you should use, but you gotta read the documentation for it in order to acknowledge how to use it. Sam1er gave you a whole example, you can use it to experiment and check how it works.
  15. You can use custom Element Data for this. It's kinda messy, but instead of letting everything (resources, chat) display the players' names, you must make them display said element data instead. There's also a better alternative, since element data uses a good amount of bandwidth. It's just a bit harder to manipulate from both server and client side.
×
×
  • Create New...