• Content Count

  • Joined

  • Last visited

Community Reputation

39 Good


About Investor

  • Rank
  • Birthday 14/04/1999


  • Location
    United Kingdom
  • Occupation
    Student & 3D modeller
  • Interests
    3D modelling, law, computer gaming, game development, level design, etc

Recent Profile Visitors

1,376 profile views
  1. Investor


    If you mean how many hours have passed since a player was last online, all you have to do is store a timestamp when he quits or logs out (via setAccountData perhaps) and compare that to the current timestamp to get the number of seconds passed, from which you can easily calculate the number of hours.
  2. Investor

    HELP Kick

    doesn't seem to appear in the provided script, which could mean encoding problems. Anyway, while checking the code I also found it to contain a couple U+FEFF characters (ZERO WIDTH NO-BREAK SPACE). The bytes 0xFEFF are apparently also used by UTF-8 for BOM (Byte Order Mark) which could be part of encoding issues, perhaps. Best would be to simply filter out invisible and special characters which shouldn't be there.
  3. The difference is that only a player can issue a command, though an event's source could be any element type. This is why the wiki uses 'player' for command source variable, but you're free to use whatever name you want.
  4. Wrong section I think. Modelling would be more appropriate.
  5. Investor

    Ped voice

  6. dutyAllow[key] is a nil value (doesn't exist). You probably wanted dutyAllow[k]
  7. XML is only useful for configurations which you want to be able to change through a normal text editor, but even for that case, JSON is probably faster and easier. SQL is best for pretty much anything else.
  8. Could be related to issue 634 as its solution changed some stuff regarding question marks within a query.
  9. What kind of client function do you need? Client functions mostly require a client because it doesn't make sense to run them unless there is a game client with rendering. There may exist workarounds on the server side for certain functions (such as isElementOnScreen is possible to calculate on the server given a camera position, rotation, fov, clipping start and clipping end, etc.), while others are impossible without a full client (such as collecting a dxScreenSource screenshot) and nonsensical (e.g. drawing dx, CEGUI etc without a client to look at it).
  10. bool isPedOnGround ( ped thePed ) float getGroundPosition ( float x, float y, float z ) getGroundPosition is client-side only and requires the world to be streamed in at that position at the time of calling the function, but if the player is above it it should be loaded.
  11. Sound isn't working because you expect music_select to be 1 to play a sound but it's never defined, so it's nil, not 1. function Ativador_Musica(Musica_Selecionada) setElementData ( localPlayer, "Mensagem", "Sim ") setTimer ( function() setElementData ( localPlayer, "Mensagem", "true" ) end, 14000, 1 ) if music_select == 1 then -- where is music_select defined? did you mean Musica_Selecionada? Musica = playSound ( "sounds/lvl.mp3" ) end end addEvent( "PlaySound", true ) addEventHandler( "PlaySound", root, start_music )
  12. Investor


    A workaround to this is forcefully cutting the line with a ZWSP (zero-width space), which is an invisible character that allows word-wrappers to break apart a line at a more convenient position. Since there's no other breaking characters in a long line of text like that one, you'll probably want to insert a ZWSP right after each punctuation sign. Ultimately, the fix must come from MTA or CEGUI developers, to make the word-wrap break after punctuation signs (that would make sense, right?). function addZWSP(str) return string.gsub(str, "%p", function(x) return x..utfChar(0x200D) end) -- replace all punctuation signs (%p) with itself followed by UTF character 0x200D (ZWSP) end This will allow the word-wrapper to break after any punctuation sign, for example, question marks.
  13. Investor

    shader issue

    float gTime : TIME; float scrollSpeed = 1.0; float3x3 getTextureTransform() { float posU = -fmod((gTime/20)*scrollSpeed,1); float posV = 0; return float3x3( 0, 1, 0, 1, 0, 0, posU, posV, 1 ); } technique tec0 { pass P0 { TextureTransform[0] = getTextureTransform (); TextureTransformFlags[0] = Count2; } } Try this (no guarantee it'll work, I'm not a shader coder). Also, this will probably look glitchy if you continuously change the speed - you should set it only once and not change it once it's scrolling or it may jump forward or back instantaneously. The parameter you need to set with dxSetShaderValue is "scrollSpeed".
  14. Investor


    The first question basically depends on whether your players will tolerate lag (hint: GUI is supposed to be responsive). If it's something like GUI, it's best to update it on the client as if it was received by the server but set a timer to revert the GUI to server-state unless you hear back an acknowledgement event from the server (i.e. that the operation was executed without error) (don't unconditionally accept any sync event, in addition to any procedural checks (making sure the data is in valid format, etc) and so on, always safeguard and send back a kind of not-acceptable acknowledgement event when the event isn't accepted by the server for, among other, anti-cheat purposes). For stuff which could give an unfair advantage or other bonuses/cheats like godmode, it would definitely be better to run the request by the server and back before any client changes are actually shown. Instead of instant change, you could show a spinning progress icon until you hear an acknowledgement event from the server (i.e. that the operation was executed without error) Higher ping will make GUIs seem less responsive if you run it by the server before actually making changes visible. Additionally, make sure to saveguard the server from accepting illegitimate sync events, so clients can't change their--or others'--data on a whim. Refreshing GUI for players in same colshape would be best done on client receive sync packet, individually per player if possible, or refresh the whole list when one player's data changes.
  15. dxDraws aren't element so they cannot emit events. As mentioned above, the closest thing you can use is onClientClient, and manually check if the client cursor X and Y are within the bounds of the dxDrawImage. That or use a dxgui API like dgs which already have that coded.