Jump to content

Mr_Moose

Members
  • Posts

    866
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mr_Moose

  1. Processor: Intel(R) Pentium(R) CPU G620 @ 2.60GHz (2 CPUs), ~2.6GHz That's a Pentium CPU, dual core and probably overclocked, in other words a pretty old CPU. You can probably get a new one for the same price, (Yes I read NEW in your main post), do you trust this person? if not it's probably some kind of scam. My theory is that this person bought a CPU that isn't compatible for his system but didn't noticed it until after unboxing it, that's why the store won't let him return it and you have absolutely no idea what he have done to it, could be broken, could be missing important parts resulting in a damaged system etc.. If I where you I would rather buy a new one, even if it get's a few $ more expensive.
  2. Mr_Moose

    Weed

    Nothing I know about, but it's pretty easy to make by combining some parts from my farmer job with my smoking system. https://github.com/GTWCode/GTW-RPG/tree/master/GTWfarmer https://github.com/GTWCode/GTW-RPG/tree/master/GTWsmoke Implied that you know some scripting of course or at least have the ability to read and understand what each part does.
  3. Mr_Moose

    script

    If you read your replies you don't need to spam this entire topic, you got the correct answer from King12 already in the second post, here it is again: addEventHandler( "onChatMessage", resourceRoot, function ( ) cancelEvent ( true ) end ) That little piece of code works excellent and don't mention compiled again unless you somehow managed to compile your meta file to, (is that even possible). You'll add this into the resource, not the compiled script files, also note that you're using this at your own risk, read the included license (if there is any) and make sure it's not someone's credits you're trying to remove.
  4. resourceRoot reduces the CPU usage compared to root but in some cases a higher level element will be needed, it's individual from case to case, try and see what's working and not.
  5. Mr_Moose

    Need help

    Have you checked '/debugscript', and honestly have you checked all locations to make sure there isn't any marker? There are three things that might be wrong, 1. 'marker' is also a class and can't be used as a variable. 2. The amount of arguments returned by unpack may be wrong, one way is to make that value more constant the way below: local x,y,z = unpack(route[currentIndex]) theMarker = createMarker(x,y,z,"checkpoint", 2, 255, 255, 0, 255) 3. replace (') with ("), not sure about lua but in other languages (') often represent char instead of string, char can only hold one symbol.
  6. Mr_Moose

    Exports

    Some functions will only work on either the client or the server, in fact, the highlighter here uses 3 different color codes to show which functions does what. Orange: Server side function Red: Client side function Blue: Shared, i.e. can be used on both sides. Now, the solution would be to add a client file to your resource with the exported function in where you add triggerServerEvent to check this value with the server, and then pass the value back, in that way you can call this exported function from both server and client, here's an example of the opposite case, server to client conversation but the principles are the same: https://github.com/GTWCode/GTW-RPG/tree/master/GTWtopbar
  7. Two important updates today, moved the project to GitHub: https://github.com/GTWCode/GTW-RPG/tree/master/GTWtrain And improved the following: [*]Added an extra distance check to prevent conflicts like spawns nearby other trains [*]Improved the stop algorithm to prevent trains from going outside the tracks [*]Allowed more carriages to attach by default [*]Improved acceleration to start and stop faster but accelerate more slowly (like a real train) [*]Added export calls to train horn so you know where the trains are by hearing them (Resource link)
  8. Line 2: 'playersource' does not point on the player, 'thePlayer' does that, Anubhav fixed it for you. If it still doesn't work, try '/debugscript 3' which will expose that kind of issues.
  9. Documentations are made to make sure users don't have to ask, what info are you missing on that wiki page? If you still have to ask make sure it's relevant like if there is something that isn't clear enough in the documentation, also it's pretty stupid claiming it's your script if it isn't.
  10. Mr_Moose

    Question

    MySQL: if you wish to sync data between multiple servers and maybe show some of it on a website. SQLite: if you just want to store a lot of data in a single server with low amount of read/write actions since it's locked by process XML: Small amount of data you wish to store on your client's PC's or to read server side like settings or a list of positions, markers or similar.
  11. How did you expect something to save if you don't not even have a script to do that? Show the code that is called by that command and the output from "/debugscript 3" if you want anyone to help you here.
  12. Mr_Moose

    Zombie proof

    Looks like I didn't read it correctly then, that also explains the illusion of how the script seems to work @dewu, tables are also elements, so you may be able to assign a value to them, however finding that value when it's needed would be more complicated, since you still have to use a solution like what Saml1er wrote above.
  13. Well not by being pissed of and write everything in caps, you need some math skills, some understanding in how the server communicate with all the clients and some patience. Here's a modified version of the nametag script from the standard race game mode, which should be relatively easy to modify in the way you want it to work: local x, y = guiGetScreenSize() function PlayerNameTags() local players = getElementsByType("player") for k,v in ipairs(players) do if v ~= localPlayer and getPlayerTeam(v) then local r,g,b = getTeamColor(getPlayerTeam(v)) local x1,y1,z1 = getElementPosition(localPlayer) local x2,y2,z2 = getElementPosition(v) local visibleto = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2) if visibleto < 14 then local sx,sy = getScreenFromWorldPosition ( x2,y2,z2+0.3 ) if sx and sy and not getElementData( v, "anon" ) and getElementInterior(v) == getElementInterior(localPlayer) and getElementDimension(v) == getElementDimension(localPlayer) then local nWidth = string.len(getPlayerName(v)) or 20 dxDrawRectangle( sx-((nWidth*14)/2),sy-7,(nWidth*14),30, tocolor(0,0,0,100)) dxDrawText( string.gsub( getPlayerName(v), "#%x%x%x%x%x%x", "" ).."", sx,sy,sx,sy, tocolor(r,g,b,255), 0.5, "bankgothic", "center","top",false,false,false ) end end end end end addEventHandler("onClientRender",getRootElement(),PlayerNameTags) Try it out and see for yourself how it works, all you need to do is to show the image instead of the text and increase the height from world position a little bit maybe. element data in the if statement named "anon" is perfect to replace with yours which you used to check if someone are in the staff team (according to your other topic). Good luck.
  14. Have you tried /debugscript 3, if not do that and post the output.
  15. Mr_Moose

    Zombie proof

    You two misunderstood each others, the first function was never called which caused it to fail, and it does work to store tables as element data, it's not the most optimal solution but apparently it works.
  16. local sx,sy = guiGetScreenSize() function showImage() if getElementData(localPlayer, "showimg") then dxDrawImage((sx-800), (sy-600), 800, 600, "player.png" ) end end addEventHandler("onClientRender", root, showImage) That's all you need, do not use server functions client side and vice versa, you had the server side part which set's the element data making it accessible to the clients. The if statement holds this: "getElementData(localPlayer, "showimg")" which will be true or false depending on if you're staff or not.
  17. local sx,sy = guiGetScreenSize() function showImage() if getElementData(localPlayer, "showimg") then dxDrawImage((sx-800)/2, (sy-600)/2, 800, 600, "player.png" ) end end addEventHandler("onClientRender", root, showImage) Now which one is it? Just modify the if statement to toggle admin or non admin.
  18. Your image is showing but it's only 2 pixels in size so you can't see it, don't make it more complicated than it has to be: local sx,sy = guiGetScreenSize() function showImage() dxDrawImage((sx-800)/2, (sy-600)/2, 800, 600, "player.png" ) end addEventHandler("onClientRender", root, showImage)
  19. nil is always nil, all variables that doesn't point on anything will return nil when trying to access them, to make a long story short, Yes. Depending on what you're trying to do it may be simpler using constant values rather than inserting lot's of pointers to nil and then trying to figure out what's wrong. What values are you using?
  20. Before it's being used, above line 2 for example.
  21. nameWidth = 1 for instance.
  22. nameWidth is not defined, you need to assign a value to it otherwise it's nil.
  23. Mr_Moose

    [Server]

    Getting an MTA server to work on linux are relatively easy, just follow this tutorial: https://wiki.multitheftauto.com/wiki/Installing_and_Running_MTASA_Server_on_GNU_Linux, or use the automatic installation script here: https://forum.multitheftauto.com/viewtopic.php?f=116&t=79920. FTP is a little bit more complicated, but the best FTP server would most likely be vsftpd, easy to setup, very cheap usage of system resource and easy to make it secure using sftp and encryption. Here's a great tutorial for that: http://www.sigerr.org/linux/setup-vsftpd-custom-multiple-directories-users-accounts-ubuntu-step-by-step/
  24. A more elegant solution would be to define custom events. triggerEvent With that you will always know which order they'll execute in, and it's easier to pass data to other resources functions instead of using set and getElementData, that saves bandwidth.
  25. That's the thing then, they used an inventory, probably id based which can store all weapons, even those in the same slot. However you can't do this by yourself using the standard features, unless you make your own inventory system from scratch.
×
×
  • Create New...