Jump to content

botder

MTA Team
  • Posts

    524
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by botder

  1. That is not even lua code. You have to use math.rad to get the degree in radian
  2. That is not efficient and you should try to do any calculation when the player logs in.
  3. Get the player's position. Get the object's position. Calculate the angle between those positions (FindRotation) and use that angle with combination with math.cos and math.sin to calculate a position from the object's position at some distance. (x0 + math.cos(angle [in rad]) * distance) Note: That will only move the object relative to the player (not camera) and it won't move the object up or down.
  4. function destroyBlipAttachedTo ( player ) local attached = getAttachedElements ( player ) That will never work, because the player is actually stored in the variable source.
  5. It looks like you have no idea what these things are doing. Is that script now clientside or serverside?
  6. Pushed the almost beta-ready version to github (https://github.com/Necktrox/debugconsole)
  7. Let's get this through: function Blip (player) The function has no ending (supposed to be at line 10) local myplayer = localPlayer() The "function" localPlayer is not a function (that makes the line actually pointless) and then the variable exists only clientside - I assume that it's a serverside script because you used onPlayerWasted local x, y, z = getElementPosition( myPlayer ) blip = createBlip( x, y, z, 20, myPlayer ) setElementParent( blip, myPlayer ) These lines will fail by default, because your variable "myplayer" is nil (use your parameter "player" instead) function destroyBlipAttachedTo ( player ) ... end addEventHandler( "onPlayerWasted", getRootElement(), destroyBlipAttachedTo) The event OnPlayerWasted actually gives you "totalAmmo" as first parameter (you used it as player). Delete it and use the hidden variable "source" for the player element.
  8. Because the script he gave you is not using the right variable (case sensitive!!) playeraccount & PlayerAccount
  9. botder

    Help fileIsEOF

    Did you also use this? addEventHandler("onClientResourceStart",resourceRoot, function () downloadFile ( "solider.txd" ) downloadFile ( "solider.dff" ) end )
  10. That's not going to work and you wrote that you wanted to use "onPlayerLogout"
  11. botder

    Help fileIsEOF

    Could you use OnClientFileDownloadComplete instead?
  12. Use the accountname instead of the player element "source" and then you have to use the player's account name (getPlayerAccount, getAccountName) everytime you want to get the timer (antiSpamAds[ accountname ])
  13. Commands don't give the player by hidden variable, but only by parameter (correct me if I am wrong). function timerDetails(source) if (isTimer(antiSpamAds[source])) then remaining = getTimerDetails(antiSpamAds[source]) outputChatBox("Time remaining "..remaining.." seconds .",source,153,51,255) else outputChatBox("Timer no longer exists",source,153,51,255) end end addCommandHandler("time", timerDetails)
  14. botder

    bad math

    Can you show us a small image how it should look Mike?
  15. In the thread itself it have been mentioned, that the extra obfuscation is decompile-able. It's harder to get the script from the memory than from a file and please don't tell me that your script is bigger than 5MB (which is still a small amount to download).
  16. Update As mentioned last time, I am not investigating all my time into this resource, so don't expect fast development. Anyway, I added today the scrollbar inclusive scrolling with the mouse wheel. Going to add the click-and-move scrolling and API functionality later and finally release it. Pictures from scrollbar (small & original): P.S. I hope that no moderator will strike me down for double posting (after 1 week)
  17. He said downloadFile and not latent events.
  18. When talking about optimization, then don't use ipairs (it's even slower than pairs) and don't use (i)pairs at all - google that please. You could also avoid grabbing every player (getElementsByType) on each frame render and do that with a table and events.
  19. The function getPositionFromElementOffset is missing too @edit: Mine code example also moves the camera away, when u accelerate.
  20. Maybe when his fps is straight 30 when the server has a fps limit of 60?
  21. function triggerSound() triggerClientEvent(v,"playBeep",v) end Why did you use "v"? function triggerSound() triggerClientEvent(source,"playBeep",resourceRoot) end
  22. Make that addEventHandler in your addEventHandler function (function in function) and the text will be available.
  23. botder

    Animation

    If you stop it clientside then it will happen only for the active client. Clientside scripts do not syncronize such changes between other clients.
  24. botder

    http server

    Short version: To run the webserver only with the neccessary client files you should only use the following directory:
×
×
  • Create New...