Jump to content

Mr_Moose

Members
  • Posts

    866
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mr_Moose

  1. Found it in "internal.db", each map has it's own table with player nick names, serial, time, date and time when the record was set and so on, the table prefix is "race_". Shouldn't be to hard to extract the information from there then.
  2. There aren't many ways to save such information but you could try searching in all the files for database or xml functions, as those may give a hint about the location. I'm not even sure if anything is saved or where to find the top times itself. I'll post an update if I find anything, but someone else might do it before me.
  3. Mr_Moose

    Streetlights

    It seems to be a part of the object, I made a map with lamp posts once and they turned of during daylight and where turned on at night, wouldn't it be easier to add a dark semi transparent panel behind those GUI elements instead.
  4. The problem might be that the function you described is client sided, yet it doesn't work on the localPlayer which makes it sort of useless in this case. You could try this (setControlState) one instead. It might not work on peds, but for player elements it certainly will.
  5. "localPlayer" is a valid argument for this eventhandler as the script loads individually for each client, another solution with the main code in focus would be to check if "source" is equal to "localPlayer" as that only occurs when localPlayer is the player who died.
  6. You should not copy your actual resources to the webserver. Copy your files from "mods/deathmatch/resource-cache" and keep any change in that folder synced with your webserver.
  7. The root of your http server file system must match the directory structure of the server files, either add the folder "Scripts" (and any subfolder below that) to http download url property. The symptom here is obvious, nothing is downloaded you say, well that's because the server sees an empty folder.
  8. Mr_Moose

    I need help

    Use the length of the array "messages" then, obtained by #messages. The code will still be very similar to gl0ck's example. if index == #messages then dxDrawRectangle ( 390, (-22)+(index*21), 593, 21, tocolor( 0, 0, 0, 240 )) else dxDrawRectangle ( 390, (-22)+(index*21), 593, 21, tocolor( 0, 0, 0, 120 )) end * You may need to use "#messages - 1" if the index never get's equal to the length of table "messages", if that happens you'll see all rectangles with alpha 120. Otherwise it should work as you described.
  9. Mr_Moose

    I need help

    Still close enough, the rectangle is drawn on line 48 and the text on line 49. You just have to move the if statement one line up and it does exactly what you want. Sometimes it's wise to read the code you try to edit. if index == 1 then dxDrawRectangle ( 390, (-22)+(index*21), 593, 21, tocolor( 0, 0, 0, 240 )) else dxDrawRectangle ( 390, (-22)+(index*21), 593, 21, tocolor( 0, 0, 0, 120 )) end
  10. This should do the trick for you: createTimeValue = tostring("21 : 10") createTimeValue = string.gsub(createTimeValue, "%s+", "") Source: http://stackoverflow.com/questions/10460126/how-to-remove-spaces-from-a-string-in-lua
  11. Technically you're assigning a function to call a function there, the most elegant solutions (lowest amount of code) should be something like my example below. setTimer(outputChatBox, 300000, 0, "Message", getRootElement(), 255, 255, 255, true) For the time argument you can use basic multiplication where 5 minutes is 5*60*1000 (minutes*seconds*milleseconds). Just a friendly advice, all the ways works and does what you want. setTimer(outputChatBox, 5*60*1000, 0, "Message", getRootElement(), 255, 255, 255, true)
  12. As a user you have to trust the license choosed by the author, I'm not saying it's easy to know exactly what's leaked or legal to use. It's something you have to consider for yourself. In some cases it's more obvious than others. For instance, a project with only a license, a poor description and all files where uploaded at the same time by the same person has the typical signs of a leaked project. Although I never seen a leaked project with a proper license, other than a single case where the thief forgot to remove the name of the original author. I was looking at the user perspective in this case and not the whole problem with leaked software, if you have any ideas yourself of typical signs of leaked code you may share them as well as it may help those who try to be honest and only use code they are allowed to use.
  13. Those who accuse are also responsible to prove their accusations, your "counter-proof" in this case are the license used for the open source resources you're using. As you can see on Github Nerd Gaming uses the MIT license, Personally I prefer GPL v3 or later as it provides more freedom for improvements and changes, but both are in fact open source and free to use.
  14. I've been running the wiki example since the 1.5 release but instead of writing to debug log I write to the server log and it seems to detect packet loss very well actually, most players never have any packet loss, others have it in intervalls like 100-500ms followed by 30-60s without any issues, followed by packet loss again and so on... I think that if you freeze a player on the beginning of this event and then unfreeze when their connection works again could be a great way to stop these "teleportations" as you describe it. I haven't tested that idea yet however, only the event itself. Go ahead and try it if you want, the only problem with freezing however is that it probably makes people with bad connections very angry as they will notice these freezes and how their controls disable during the freeze which for them feels like they have some kind of lag on their clients. It's probably smart to inform them by a dx message or similar about why they are frozen. Also watch up for conflicts in other resources like if you freeze someone with your admin panel, you don't want them to get unfrozen because they had a little packet loss.
  15. It's easier to use as a command obviously so why not, function check_if_banned(plr, cmd) local is_law_banned = exports.GTWpolicechief:isLawBanned(plr) if is_law_banned then outputChatBox("True", plr) else outputChatBox("False", plr) end end addCommandHandler("checkmyban", check_if_banned) Run the code in any resource except GTWpolicechief (as it has exported calls). The command is "/checkmyban" and will validate the player using the command, this should be running server side.
  16. There are built in commands for that. "/lawban " and "/revokelawban ". After that you can use: "/listlawbans" to verify that a real account was added to the list successfully, only policechiefs can add or remove lawbans and only server administrators can add or remove police chiefs using "/addpc " and "/removepc ". To check if you successfully added a police chief you can list all police chiefs by using: "/listpolicechiefs". All these commands works as soon the resource is started without other requirements. Check that first then run the above code.
  17. Run this and let me know the result, replace client with any player element that is logged into an account that is currently banned from law. local is_law_banned = exports.GTWpolicechief:isLawBanned(client) if is_law_banned then outputChatBox("True") else outputChatBox("False") end
  18. On line 2 you also use this piece of code in your if statement: exports.GRGPlayerFunctions:isLawTeam Are you sure that's not a function? written the way it is now it's seen as a variable which isn't defined and thus it will always be seen as false meaning no matter what the other condition are it will always skip that check. Try this: local is_law_banned = exports.GTWpolicechief:isLawBanned(client) local is_law_team = exports.GRGPlayerFunctions:isLawTeam(client) if is_law_team and is_law_banned then exports.GRGMessages:sendClientMessage( "You are banned from Law Jobs! choose another job.", client, 255, 0, 0 ) return end triggerClientEvent ( p, 'GRGJobs:OpenJobMenu', p, 'police' ) Still confused about line 2 however, how does it know which player it should check, what's the correct syntax for that? GTWpolicechief is already used correctly.
  19. Show the code where you call the exported function, it returns a boolean value indicating if the player is banned or not, here's an example on how you can use it. Also note that you must be logged in, otherwise it will skip the check as the feature is disabled for players not currently logged in. local is_law_banned = exports.GTWpolicechief:isLawBanned(client) if team == "Government" and is_law_banned then exports.GTWtopbar:dm( "You are banned from the government team! choose another job.", client, 255, 0, 0 ) return end
  20. Account data creates useless requirements, if you want to change the database structure you'll be forced to edit multiple resources instead. This looks like a part of this system, which has exported functions to check if someone is a police chief or banned from law. All you have to do is to call the exported functions and get true or false in return then the system manages the rest, like the database for instance.
  21. You didn't change anything from yesterday. You need to start the default resource "interiros" in order to enter shops, police departments and other buildings. Then you need to download the latest version from 'master' branch to get all the latest patches regarding the event 'onClientSend' for instance.
  22. All right, one last bug resolved. The event "onClientSend" should not trigger for all resources from now [Solution] Freeroam is not needed, GTWaccounts should manage everything related to spawn, fading of the screen etc.. And finally you still haven't added required ACL groups for GTWstaff, either do that or edit GTWstaff to use your own staff ranks.
  23. Which version are you using? are the missing resources even presented? All those error messages says that some resources aren't running at all. Take a look here again: https://github.com/GTWCode/GTW-RPG/blob/master/INSTALL.md, it's updated along with many other files within the last hours. Also make sure that the top bar system (GTWtopbar) is running properly. Turns out some of the resources wasn't added to the installation guide on Github yet, you need to start them as well if they have dependencies.
  24. <!-- GTW-RPG resources required ACL rights --> <group name="GTW_RPG"> <acl name="GTW" /> <object name="resource.GTWgui" /> <object name="resource.GTWupdates" /> <object name="resource.GTWaccounts" /> </group> <acl name="GTW"> <right name="function.callRemote" access="true" /> <right name="function.restartResource" access="true" /> <right name="function.addAccount" access="true" /> </acl> And continue like that until all errors are resolved. You need the default resource "interiors", in order to enter the shops. And GTWtopbar must be started first of all to prevent errors due to calls to that one as pretty much all resources has calls to the topbar for notifications.
  25. Even if we do write a resource just to install a few ACL rights that resource would also need some ACL rights to modify the ACL file. Try to understand how the ACL works and how you can modify it, only you as administrator on your own server can alter these rules, another option is to let someone else do it for you but I wouldn't recommend it as the chances are pretty big that they just destroy your server and disappear.
×
×
  • Create New...