Jump to content

Moony

Members
  • Posts

    96
  • Joined

  • Last visited

Everything posted by Moony

  1. It is still giving me an error in debugscript. I've also noticed that there is no outputChatBox in your script. I've tried the following, but it gives me an error (line 14, 'then' expect near '=') in every option: The only difference is the 'end' over and under 'outputChatBox'.
  2. Is it possible that there's a server.Lua 'EventHandler' missing? Nothing's happening when I start the resource from the admin panel. I tried adding an 'addCommandHandler', but the debugscript is giving me an error on that error. I left the other files untouched. My server.Lua looks like this: I'm sorry, but I don't exactly understand how to relate the setCameraTarget with the server/client relationship.
  3. I'll definitely check that out. That is pricesly the issue. I want to stop 'freeroam', but there is no 'freeroam' in the mtaserver.conf. I dare to say there is some kind of parent that's handling several resources, including 'freeroam'.
  4. I'm having trouble translating the scripts into colloquial language (to build the concepts in my head and understand what happens and what triggers the events). My ultimate objective is to add a help window that shows the functions of my server. This is what I researched so far: *I know some things may be obvious to the experienced developer. My intension is to "think out loud" so, if I'm mistaken, the reader(s) will point out my errors. With a stock MTA, pressing 'F9' (resource: helpmanager) opens a help window that shows two tabs: 'votemanager' and 'freeroam'. Respectively, each are run by their own resource that go by the same names. This means that if I stop one, the tab will be gone; If I stop both, there will be no tabs visible. Therefore, it is safe to say that both tabs are being added by a script (the window elements creation, the text, the size, etc), into the 'helpmanager' help window. While I can edit either tab to show the desired info, if I plan on stopping both resources (votemanager and freeroam) from starting in the near future, they will not be visible. Thus, the only path left I have is to add a script of my own that will only show the desired info in a new tab on the 'F9' help window. My questions are: - How can I create a text inside new tab inside the window of another script? *I know how to create a window. My issue is creating an uneditable text inside the window of a different resource. - How can I stop 'votemanager' and 'freeroam' from starting when the server.exe is ran. *I've tried looking for the resource in mtaserver.conf, but I can't find any trace of a resource that's related to freeroam. I do want to keep 'play', for the moment.
  5. Estoy siguiendo este tutorial. Al momento, tengo esto: El script está ubicado dentro de una carpeta ("client"), y el archivo se llama "gui.Lua". El meta.xml está editado de tal manera que vaya a buscar el script a cliente/gui.Lua. He reducido el script a elementos más simples para testear las partes. Al momento, solo tengo habilitada la ventana; todo el resto está removido. No funciona. No tengo errores en la consola, pero tampoco tengo una ventana en el juego. ¿Es posible que el tutorial tenga errores o esté desactualizado? ¿El error lo estoy cometiendo yo? ¿Cómo lo puedo arreglar? Descubrí que tengo muchos errores y elementos faltantes. No pude encontrar alguna función para eliminar el post.
  6. I'm new to this. I'm having trouble understanding the functional part of it. I do understand the idea, though. This is what I understood from your comment: since this is a client event, I need to create a script that's running in a "client.Lua" file. I created it and edited the meta.xml to look for the source file (type="client"). Up to this point, is this the correct way to proceed? The script looks like this: function joinHandler() -- player spawns at coordinates 2023, 1008, 10.83, with a rotation of -90, and a randomized skin id between 1 and 288. spawnPlayer(source, 2023, 1008, 10.83, -90, math.random (1,288)) -- screen fades from black to color. fadeCamera(source, true) -- if target not defined, syntax maintains player targeted setCameraTarget(90, 90, 90) -- (targetX, targetY, targetZ) adding different values ranging 0-359 changes nothing end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) I added X, Y, Z = 90 to have round values and to see a noticable change to the camera, if any. And just to be sure, I added the same line to server.Lua. Console threw an error coming from server.Lua, so I deleted the line and the error went away. However, the script doesn't seem to be working. Nothing is happening. The camera is still pointing to the north. There are no errors coming from client.Lua. (off context: how come the error only comes from server.Lua, even though both server.Lua and client.Lua have the same line?)
  7. Thanks for the quick answer. I'm getting an error: SCRIPT ERROR: chatbot\script.Lua:14: 'then' expected near '=' ERROR: Loading script failed: chatbot\script.Lua:14: 'then' expected near '='
  8. I apologize for the necroing, but I have a quick question. If I wanted the interval to be less than a minute, so I can output a few messages that need to go connected, how would I change the interval? What about having an order, instead of outputting the messages randomly?
  9. I'm daring myself to add more little things to the tutorials shown here. It's of great pleasure to announce that the following code works. I know it is not much, but it's one more step closer to my dream server. So, function joinHandler() spawnPlayer(source, 2023, 1008, 10.83, -90, math.random (1,288)) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("¡Bienvenido!", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) You can skip the spanish words. The result is as expected: when the player joins, the chatbox shows the text, the player is looking at the east, and the skin is randomized between 1 and 288. However, the camera is aiming at its default value: 0. The result has a rather inconvenient detail: the camera is looking at the right side of the character's body. UPDATE: I added setPedCameraRotation. There are no errors being detected, but the camera is not changing at all. function joinHandler() spawnPlayer(source, 2023, 1008, 10.83, -90, math.random (1,288)) fadeCamera(source, true) setCameraTarget(source, source) setPedCameraRotation(source, 90) outputChatBox("¡Bienvenido!", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) How can I modify where the camera is looking at when a player joins, so that way it looks at the same place the character is looking?
  10. Excuse my second beginner's question. I'm struggling with the functions. Do you come up with them? Is there a list to such commands? Scrolling through this, this, and this doesn't show any 'checkOnline' function. It does show a 'check' function, but it doesn't seem to be one for such script. UPDATE: is it normal that it doesn't work from the console, yet it does when tiggered from the in-game chatbox?
  11. [SOLVED] This will certainly be a beginner's subject. The folder [gameplay], located in "Resources", is filled with .rar files. I want to edit 'help.xml', which is inside "freeroam.rar". I tried extracting everything into a new folder called "freeroam", but my server is not detecting said folder. I'm sure I'm ignoring a command somewhere that's failing to locate the folder (might be written to only locate "freeroam.rar"). What can I do to reach the file, modify it, and keep the freeroam files working?
  12. Scrolling through the tutorials, I found a script that displays players in the server when joining and quitting. function playerCount ( ) outputChatBox("#ff8800[server]: #ffffffPlayers: #ffffff(" .. getPlayerCount() .. "#ffffff)" , root, 255, 0, 0, true) end addEventHandler ( "onPlayerJoin", getRootElement(), playerCount ) addEventHandler ( "onPlayerQuit", getRootElement(), playerCount ) What would I have to add to trigger it with a command, such as "/players"?
  13. [SOLVED] Hello, MTA community. Recently, I've started practicing setting up a server and building it. I've been dowloading seemingly simple resources to get the hand of .Lua, .xml, the admin panel, and whatnot. I found this compass, which adds the compass from PUBG. It is a horizontal scrolling ruler on the top center of the screen. North and south show as they should, but the east and west are inverted; not because of the text, it's because of the scrolling being inverted. In other words, if the player turns the camera to the right side of the character, the compass scrolls to the right (it should be the opposite of where the player is turning the camera). Similarly, if the player turns the camera to the left side of the character, the compass scrolls to the left. It's my first time posting about server development. If you wish to see the .Lua or .xml files, don't hesitate on asking. UPDATE: After trying to read and understanding a few items of the client.Lua, I realized that the solution would be to invert the value. If the compass moves along with the camera, I need to invert the movement, so it moves contrary to the camera's X axis. Line nº40 is <local _, _, r = getElementRotation(getCamera())>. Is this the one I need to invert? How can I do so?
  14. Moony

    Mta has not sound

    Excuse me for asking the obvious, but have you checked every single sound slider and sound setting in MTA and in the PC's?
  15. Moony

    ayuda

    Podrías intentar comunicándote con el staff del servidor, ya sea a través de las apps de comunicación que usen (Discord, Skype, etc), o por el foro, si tienen. Parecería ser más un problema del servidor que de MTA en sí.
  16. Greetings, fellow gamers! I recently started having this really annoying issue with MTA:SA 1.5. Basically, servers that should give me two-digits ping give me three-digits. These servers are close by (in my country). When I say recently, it means that it wasn't like this before. In the following list (screenshot) the first 5 servers had around two-digits ping. https://imgur.com/a/WUAWi Discarding the obvious: -My PC runs GTA:SA perfectly fine, with an average of 40fps in highest graphics. No problem on that. -No applications - those that connect to the internet - are opened in the background while playing the game. -Anti-virus not running scans, nor updating. Updated mind information: Now that I think about it, I did modify a few things when I tried to host my own server, a couple of weeks ago. Gave up after finding no way to enter my router's settings to foward ports. I remember modifying IPv4 and IPv6 to find a way into my router. I can't quite remember which were the defaults. At the moment, both are in "Obtain IP automatically". I also used a program called "Port Foward Utilities" that the MTA Wiki recommended. I will try modifying a few things, see if that changes anything. If I do find a solution, I'll edit this post. If no updates are seen, anyone is free to lend a hand. Thanks in advanced! Moony -
  17. Moony

    MTA:SA Race Error.

    Went to two sites to download the .exe. Both were the same one. After having one fully downloaded, ran it, installed it. After installation i got the next msg: Reinstalled it several times. Tryed diferent dload sites. Same error over and over. PC Specs: OS: Windows 7 x32 bit Processor: Intel Pentium Dual CPU 2.00 GHz Graphics Card: nVidia GeForce 8600 GT. Additional Info: Ran this program many times before (i was using WinXP SP3). PS: Any thing you want me to add, let me know. - Moonyman
  18. Moony

    Scripting

    And varez, one last question. Where did you got that link for lua? Mind if i use it?
  19. Moony

    Scripting

    I recently started learning LUA and its things. Someone sent me this example of a LUA file and as usual, i dont understand it. function test ( player ) local name = getPlayerName ( player ) outputChatBox ( name ) end function testB ( player ) outputChatBox ( getPlayerName ( player ) ) end addCommandHandler ( "command1", test) addCommandHandler ( "command2", testB) I'd like to know the following things: Definitions of: -"local" -"getPlayerName ( player )" -"outputChatBox ( name )" -"addCommandHandler ( "command1", test) addCommandHandler ( "command2", testB)" Basically its every meaning of every part of the function. Thanks very much!
×
×
  • Create New...