Jump to content

Mr_Moose

Members
  • Posts

    866
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mr_Moose

  1. Take a look at these functions: createFire -- To make a realistic client side fire getElementPosition -- Detect how far away you are from this fire getPedControlState -- Detect if the fireman is working givePlayerMoney -- Pay the fireman, after successful work?
  2. Mr_Moose

    Modules

    Modules are class libraries and extensions, they are compiled into .dll files in Windows and .so files in Linux and imported via "mtaserver.conf" under that section with modules. Making a module should be just like writing a class library in C++, try with something simple. Use the gcc compiler on Linux or visual studio if you're on Windows.
  3. Mr_Moose

    Modules

    You had the link right here: https://wiki.multitheftauto.com/wiki/Modules, download the library and check it, c++ files are compiled by commands in the file named "MAKEFILE", unpack and use cd to the location of your make file then type "make" and run. If you're unfamiliar with c++ then learn it,
  4. Your server won't shutdown just because it uses too much CPU, the only thing you may notice are lag, the real issue might be lack of RAM or a generally unstable hardware, what are your servers specifications, and which operating system are you running on it?
  5. Mr_Moose

    SQL

    The keywords 'Group' and 'Count' may be reserved, have you tried giving them another name, just pick something random.
  6. Mr_Moose

    SQL

    It's obviously a syntax error, SQL queries are case sensitive so it could be as simple as a misspelled word. You may find some more help in it's documentation, https://wiki.multitheftauto.com/wiki/ExecuteSQLQuery
  7. Peoples parents would most likely care too, this solution wasn't invented for kids in the first place, it's made for people with a large technical interest that want to have their own server, nothing says that you have to run it 24/7 either, nothing says that you have to buy the electricity from a large power plant or whatever you got nearby either. Use your imagination and apply the solution in a way where you can gain profit from it, a 24/7 server may consume a lot of electricity, meanwhile you get heat in return, which can be used to warm up a building during the cold winters we have up in the north. If you don't have cold winters where you live, or a house to warm up, don't blame me, you have to accept the fact that this isn't some kind of universal solution that works for everyone.
  8. This is a simple resource written only because I thought a horn was missing on the trains, I uploaded it to the community and will soon add it to github as well, here's a video of how it looks while in use, enjoy. Preview: Download link: https://github.com/GTWCode/GTW-RPG/tree/master/GTWtrainhorn Features: Press 'H' to play the horn sound, (it will stop automatically) Horn will be heard by players around your train in a long distance If your train has more than one engine attached they will all play the horn sound at the same time Key is bound when you enter any train and won't affect other horns or sirens. Licensed as GPL v3.
  9. Mr_Moose

    Internet Speed

    It's acceptable but expensive, with a fiber cable all the way up I don't see any reason not using it to it's full potential
  10. Updated the tutorial and added simple installation scripts, enjoy.
  11. Mr_Moose

    Problems :/

    Background = guiCreateStaticImage(x*200, y*240, 606, 340,table.concat(Menus[random]), false) Button2 = guiCreateStaticImage(370, 80, 130.32, 61.92,"gfx/images/button-low.png",false,Background) Button3 = guiCreateStaticImage(320, 150, 213.96096, 61.9704, "gfx/images/button-mediun.png", false, Background) Button4 = guiCreateStaticImage(380, 220, 100.2, 75.6, "gfx/images/button-big.png", false, Background) Button22 = guiCreateStaticImage(370, 80, 130.32, 61.92,"gfx/images/button-low2.png",false,Background) Button33 = guiCreateStaticImage(320, 150, 213.96096, 61.9704, "gfx/images/button-mediun2.png", false, Background) Button44 = guiCreateStaticImage(380, 220, 100.2, 75.6, "gfx/images/button-big2.png", false, Background) Close2 = guiCreateLabel(578,10,15,15,"✖", false, Background ) Close = guiCreateLabel(580,8,15,15,"✖", false, Background ) Button222 = guiCreateStaticImage(370, 80, 130.32, 61.92,"gfx/images/button.png",false,Background) Button333 = guiCreateStaticImage(320, 150, 213.96096, 61.9704, "gfx/images/button.png", false, Background) Button444 = guiCreateStaticImage(380, 220, 100.2, 75.6, "gfx/images/button.png", false, Background) guiLabelSetColor(Close2,0,0,0) guiSetVisible (Background, false ) showCursor( false ) addEventHandler("onClientGUIClick", Close, function() showCursor( false ) guiSetVisible(Background, false) end) addEventHandler("onClientGUIClick", Close2, function() showCursor( false ) guiSetVisible(Background, false) end) function ShowGUI( hitPlayer ) showCursor( true ) guiSetVisible(Background, true) end addEvent("showGUI",true) addEventHandler("showGUI",getRootElement(),ShowGUI)
  12. That shouldn't be any problem at all as long you're not running a very resource ineffective game mode that transfers a large amount of data between server and client, does the server exist yet or is it new? that question says something about the player amount because new servers usually has a low amount of players. Your PC has pretty good performance up to ~500mbt/s network speed up and down, after that it will most likely be the hard drive who slows everything down. Don't worry about performance I also strongly recommend Linux for this machine and Debian is one of the best distributions for servers in my opinion, to prove how far you can go without having lag I set up a default freeroam server long ago with some extra features at a 15 years old laptop running Linux, specifications for that are the following: 512MB ram, 1.2GHz pentium CPU, 60GB hard drive, and a network speed of 10mbt/s fiber. It's still active and you can try it out here. The only thing you should be careful with while hosting on your home network are DDoS attacks from competing servers with immature owners, since that will take you down from the internet as well, my favorites solution to that problem is not only to have a fast network but also multiple networks. Good luck.
  13. What you mean, isn't it closed? It means that for every '(' you write there must be a ')' to close it. All according to the syntax of course so make sure you close them in the correct place.
  14. Mr_Moose

    Problems :/

    You should create the "Background" static image in the root of your script and then hide it, the function ShowGUI should only make the GUI and the cursor visible, as it is now you're making a new GUI every time you hit the marker.
  15. Mr_Moose

    Problems :/

    Where is "Background" defined? show us that part.
  16. Mr_Moose

    Problems :/

    You made a dx gui so guiSetVisible won't work, you need a boolean to toggle and an if statement in your onClientRender event to make it work.
  17. Mr_Moose

    Problems :/

    So what you're trying to do is to make a new client GUI, right? I suggest you check the original client file, to find out how the marker hit event should be handled. How did you managed to screw up that functionality in the first place?
  18. Mr_Moose

    Problems :/

    Have you tried downloading the most recent version of this script? https://community.multitheftauto.com/index.php?p=resources&s=details&id=8041 http://code.albonius.com/?action=download&id=0f53ef21962dfc0647b0e2dd364345f6 https://github.com/albonius/gtw-rpg/tree/master/GTWfastfood That one you got there are really outdated, so where did you got it?
  19. nil is not a string so if the value was nil then outputChatBox would have failed too, obviously something is passed but it's empty. Keep that chatbox part until you are sure that the correct parameters are received on the server, you may also need to check the documentation for triggerServerEvent. In the example there it's used like this: triggerServerEvent ( "onGreeting", resourceRoot, "Hello World!" ) Which would make your client side part look like this: outputChatBox(tostring( block ).." "..tostring( anim )) -- Add this line to see how your arguments looks like before they are passed to the server. triggerServerEvent("animaatio", resourceRoot, tostring( block ), tostring( anim )) That should output block and anim before and after it reaches the server, in that way it's easier to find out where the problem is.
  20. In that case, something goes wrong when you send the info from the client to your server, resulting in a nil animation wich is equal to stopping it. You must also check the argument line in your server side function, replace this: function anim1 ( source, block, anim ) with this: function anim1( block, anim ) , otherwise "source" will contain the value of "block", "block" the value of "anim" and "anim" will be nil and useless.
  21. If the animation doesn't work there may be a couple of reasons for that, first you may check if the play button actually passes the correct data to the server script, let it show if it get's the animation and the block by doing a temporary output, you should also avoid passing a player element to the server, in any other way than using the "client" variable. -- Server Side function anim ( thePlayer, block, anim ) outputChatBox("Block = "..block..", Anim = "..anim, client) setPedAnimation ( client, block, anim, 0, true, true, true ) -- Edit: 0? infinity is -1 so 0 will probably never start the animation. end addEvent("animaatio", true ) addEventHandler("animaatio",getRootElement(), anim) I assume you are trying to merge these resources right? https://github.com/albonius/gtw-rpg/tree/master/GTWanimations https://github.com/albonius/gtw-rpg/tree/master/GTWphone In the older versions of those there used to be similar issues like animations that failed to start, even if everything in the code was written correct, however the current version of the animation trigger looks like this: setPedAnimation(client,animationBlock,animationID,-1, true, false) And it works pretty well without any bad syncing or "lagging" animations, in your case that line should look like this: setPedAnimation(client, block, anim,-1, true, false) I'm not 100% sure about that 0 in your animation time argument, as far as I know you should use -1 for infinity while 0 probably means 0, which results in a animation that never starts. You may try to change that as well.
  22. Mr_Moose

    [Q&A]

    Well it's relatively simple, like a top bar which lists messages and fade them out after a while, you could try modifying this one: https://github.com/GTWCode/GTW-RPG/tree/master/%5Bresources%5D/GTWtopbar by adding images and recalculate the position details so it shows on the right (or left side).
  23. The problem is most likely a missing element data on "gang", check your mtaserver.conf file and see which order your resources are loaded, where are "gang" set to a player, if the resource who gives a player a value on their element data "gang" starts after this one, it won't add your blip when you join or spawn. I suggest you change the order of how your resources are loaded so the gangsystem (or whatever resource that sets "gang" is) loads before the player blips resource you are working on. The reason why it works when you restart your resource is because it's loaded after the client got his "gang" data applied. Try that and see if it helps.
  24. The first error are found in the place where you call 'createDutyColShape', because you didn't passed the correct arguments there. The second error appears because you can't access your database. The only way to find out is by reading the code.
  25. Sounds like you have duplicated entries for that right, you said that you restarted it ~20 times, does the value change back to "true" again or what's the reason for that? Are you sure that you wait for the server to completely shut down, before saving your changes? Have you tried editing the ACL from the webadmin panel? (http:// and usually port 22005).
×
×
  • Create New...