Jump to content

Dealman

Members
  • Posts

    1,421
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Dealman

  1. Much like the error suggests, you haven't properly closed some function in the server file. Did you paste it correctly, because some parts seem to be missing?
  2. if ( ( getPlayerMoney ( localPlayer ) >= gTEXT ) and ( gTEXT ~= "" ) and ( gTEXT ~= " " ) ) then This line is entirely unnecessary. You've already converted it to a number, why check if it equals "" or " "? Those 2 if statements would always return false
  3. That's because you need to use triggerServerEvent to transfer information/data from the client to the server. Read that page thoroughly and I'm sure you'll figure it out
  4. takePlayerMoney(client, tonumber(textPrice))
  5. UIKit is just a framework, you still need to create your own local webpages. The resource simply needs to be running and you can access it from whichever resource you want. You have information on how to use it in the thread. I made an example webpage for a login screen, which you can find here.
  6. Because much like the name suggests, guiGetText gets the text - a string. String is not a number. You can however try and convert a string to a number like this; local theValue = tonumber(textPrice)
  7. You're trying to set the volume of a sound element that does not exist, hence the error; "bad 'sound/player' pointer". You can eliminate this error simply by checking if song is an element using the isElement function.
  8. That's because it only applies to the native radio player within GTA San Andreas. The volume slider you'll need to change is MTA Volume, which is any sound produced via MTA itself.
  9. I find it rather odd how you're fine with people decompiling your script, but release it as compiled. You might as well just release it uncompiled then...? Also, your server.lua script is empty, yet included.
  10. I actually find the OP's code to be more clean and easier to understand. Parenthesis's are not needed, no, but they do make it easier to read. I made a tutorial on naming conventions a while ago. You seem to follow it for the most part, what I would suggest would be better function names. Also the check for whether id is not nil or false is kind of redundant since you check if it's an integer later on. (And you don't have an else statement to do something if it indeed is nil or false) Edit: I would've written it something like this; function CreateVehicleFromID(thePlayer, theCMD, theID) if(type(tonumber(theID)) == "number") then if(theID >= 401 and theID <= 611) then local pX, pY, pZ = getElementPosition(thePlayer) local theVehicle = createVehicle(theID, pX+5, pY, pZ, 0, 0, 0, "Crossy") local vehicleName = getVehicleName(theVehicle) warpPedIntoVehicle(thePlayer, theVehicle) outputChatBox("You've created a "..tostring(vehicleName), thePlayer, 0, 187, 0) elseif(theID <= 400 or theID >= 612) then outputChatBox("Error! Entered ID is invalid.", thePlayer, 187, 0, 0) end else outputChatBox("Error! ID needs to be a number!", thePlayer, 187, 0, 0) end end addCommandHandler("v", CreateVehicleFromID) Also the first example on getElementMatrix lets you make sure the car is always spawned at a fixed location relative to you.
  11. Dealman

    [Help]

    Is it really that important to go off-topic only to point out that it's Lua and not LUA? @S1mple: You'll need to try doing things yourself, or you'll never learn. You were already given the basic functions needed to accomplish this, all you need to do now is study these functions - and think of a logical solution. 1. You need to get the position between you and the other player(s). local allPlayers = getElementsByType("player") 2. Loop through all the players, and compare the distance between them and you. for i=1, #allPlayers do local pX, pY, pZ = getElementPosition(allPlayers[i]) local sX, sY, sZ = getElementPosition(localPlayer) local theDistance = getDistanceBetweenPoints3D(pX, pY, pZ, sX, sY, sZ) if(theDistance <= 10) then toggleControl("aim_weapon", false) toggleControl("fire", false) else toggleControl("aim_weapon", true) toggleControl("fire", true) -- We need to reset it to true if the check failed, otherwise they may get stuck with the control disabled. end end There you have something to start with, go from there.
  12. You need to use the server-sided triggerClientEvent in order to inform all clients to play a sound.
  13. You do realize you're creating a new shader with every frame, right? You only need to create it once. I doubt you need 30-60 new shaders per second You then draw the shader via dxDrawImage.
  14. Would assume they're packaged inside the .zip files under GTW-RPG/[misc]/[default].
  15. Either you'll need to use shaders to accomplish this, or you could check out samt2497's Holoscreens resource.
  16. You'll need to use injectBrowserMouseDown(see the example) if you want to use the DX browser instead of the CEGUI one.
  17. Just because you paid for the script doesn't mean it was a legitimate copy of the product. I could buy pirated movies, does this make it a legitimate and legal purchase? No, it does not. We don't provide support for leaked scripts out of respect for the original author. If it's something that was leaked, it's very likely you do not have permission to modify said script. Thus, we do not offer our help.
  18. You do realize that official implies it was made by the developers of the product, right? If anything, you should name it Unofficial.
  19. Dealman

    Delete my topic

    Why would you post this in Map Support? Simply report your own thread and ask for it to be deleted.
  20. You'll be able to use triggers and timers just fine, whether client-side and server-side. So long as you use it wisely. The biggest performance impact will be with rendering stuff. Don't do calculation heavy stuff within onClientRender for example. 1. You can use setPlayerNametagText. 2. You'll need to use string.gsub to remove it. You can use it like this; getPlayerName(playerElement):gsub("#%x%x%x%x%x%x", "") string.gsub(getPlayerName(playerElement), "#%x%x%x%x%x%x", "") 3. Use removeWorldModel to remove world models. 4. The GUI Editor has a colorpicker embedded with it. I believe it's also uploaded to the MTA Community. All of this you could have found by searching these forums...
  21. Dealman

    Math

    And how is valc[5] defined? What does it contain? Also you can just multiply by 1.5 and -0.5 and you'd get the same result.
  22. What are all the sliders for? There's currently no equalizer functions as far as I'm aware?
  23. As far as I'm aware there's no "hate" towards helping people with a script that isn't theirs, at least I have no issues with it and I'd gladly help. What I do have issues with, however, is when people use someone else's work and don't give credit where credit is due. Even more so, people that use leaked scripts or decompiled scripts without the author's permission. So long as you don't make the claim that it is yours, you'll be fine. And giving credit where due is always a nice thing to do. If someone has a fit because you're using something you didn't make, simply ignore them. They're usually no better themselves and calling people out is a way for them to make themselves feel good.
  24. Not a fan of the design either, here's some feedback; • Bad font, it's very pixelated. • The toggle buttons are a bit too big. • Some text is clipping behind the buttons. • Spinning icons doesn't make it look cooler or more advanced, it's just annoying.
  25. Dealman

    Area name

    You can hide the default area names by using the function setPlayerHudComponentVisible. You can use getZoneName to get the current name. And dxDrawText to draw the text. Simply put, create your own resource that checks the player's current zone. Make an if statement that checks if the zone name is equal to "Restricted Area", if true, draw "War Zone" instead.
×
×
  • Create New...