Author Topic: [SCRIPT] Police Computer  (Read 3769 times)

Please read the following statement before dismissing this post as too long and moving on to another topic:
You only really need to read the flow chart and/or the list of chat commands to get an idea of what this is. The chat commands are all I need.


I think that a very useful mod for many servers, especially my own, would be a police computer script. Many people saw my old idea, but I realized that it was too big, hard to make, and unrealistic. So I hereby present you with: Police Computer Suggestion Topic v2!
If you've ever played LCPD:FR, it's kind of a cross between the computers in versions 0.95 RC2 and 1.0.
If you haven't, read the following:




And/or

    Chat Commands:
    • /searchID [ID] - Searches for the BL_ID in the database. It says the BL_ID, online/offline, and tags in the chat for that ID.
    • /listcategories - Lists the tag categories.
    • /createcategory [category name] [default tag] - Creates a category using the name and default tag that you list. (Host only)
    • /removecategory [name] - Removes the category (Host only)
    • /listeditrights - Lists everyone with edit rights
    • /granteditrights [ID] - Gives that ID the right to edit the computer. (Host only)
    • /revokeeditrights [ID] - Revokes that ID's right to edit the computer.
    • /edittag [ID] [Category Name] [Tag] - Changes the tag for that ID, in that category, to what you put in the third space.
    • /toggleaccess - Toggles whether or not everyone can access the computer. When you type the command, it sends a chat message to the server saying "Access to the computer is now: ["Public or "Restricted"]"
    • /listaccessrights - Lists everyone who has the right to access the computer.
    • grantaccessrights [ID] - Gives that ID the right to access the computer. (Host only)
    • /revokeaccessrights [ID] - Revoke's that ID's right to access the computer
    • /policecomputerhelp - Lists all of the commands above
    If you try to type any of these commands besides /policecomputerhelp and you don't have permission, it says "You don't have permission to do this, sorry."
    If you type a command but it can't find what you are trying to do, for example, if you typed the wrong ID when searching, it says "Sorry, but the computer is unable to find what you are searching for. Please review your command."

    The list of IDs that you can search for is made up of every ID that has ever spawned on the server.

You don't need to read this unless if what was said previously just wasn't enough for you:
     First, to access it, you would have a key bind to open the GUI, or, if possible, use a chat command. You would be allowed to restrict access to it if you want to, but we'll talk about that later. The home screen would just be a text box at the bottom, with maybe a blue or white color scheme. There would be a button to edit the database at the top-left, which would be restricted. At the top right there would be an x to exit.
     You can type a BL_ID in the text box at the bottom to search the database. The database is made up of every ID that has ever spawned on the server and not been deleted. Any BL_ID with all numbers that you've typed in the same order will show, IDs spawned on the server first from lowest to highest, then IDs not spawned in the same order. Double-clicking an ID will bring you to a screen that has the current name being used for that ID as well as the ID at the top as a heading, with a back button in the top left instead of an edit button. Under it is the current state. (Deceased - On the server but not spawned. Online - Spawned on the server. Offline - not on the server). After that are all the custom sections/tags on the server.
     If you click edit, it tells you that "You can't access this section, sorry.", unless you have edit rights. In that case, you are brought up to a screen similar to the home screen. The only differences are that at the bottom, there is a button for "Edit Sections" and "Edit Access," and that instead of saying "Edit" in the top left, it says "Back." Like the home screen, you can search for BL_IDs. When you double-click a BL_ID, the same kind of screen cones up except that now you can edit how people are tagged. For example, let's say that you made a section for "Driver's License," and made the default tag be "None". You can change that by going to the ID in edit mode and double clicking on that line. When you do that, a text box would come up where the word "None" was, with the word in it. You can change it by replacing "None" with whatever word in the text box. Another option is "Delete ID" at the bottom. This will prompt you first, and then if approved will clear the ID from the database. If the person is online, server crash it resets them as if they just spawned for the first time. This makes them go to the default tag in every section.
     If you click edit and go to "Access," it tells you that "You don't have permission to access this section, sorry.", unless you are the host. If you are the host, it brings up a window that allows you to add/remove IDs for who can access/edit the police database 'tags', who can edit the sections, as well as toggling if being able to look at the police database is restricted or not.
     If you click Edit>Sections and you are allowed to access it, you are given a list of all current sections as well as the option to add a section. Double clicking on a section in the list will allow you to edit it's name, remove it, and change the default tag. There is a check box for "Reset Tags?", and there is a save button in the top right. It does nothing until you click save or remove section and accept a prompt. When you accept it, it applies your changes and goes back to edit>sections, saving everything in the database. Clicking "add section" will bring up a window with a box for the section name and a box for the default tag, as well as a cancel button in the top left and a save button in the top right (under the x to close).
« Last Edit: January 23, 2014, 08:47:45 PM by Who Cares99 »

We all know what you would use this for bro. Great idea, I honestly see almost no issues with it.

I'll hopefully finish the flow chart today. Be advised it's crap

He double-clicks on the ID 7610, which makes the text box on the bottom-left contain the ID 7610, and the text box on the bottom-right contain the word "None" (The default tag). He changes the word "None" to "Active" or whatever word he uses to mean yes they have a license. (List items 4-5 demonstrated)
Aww, thanks bro.

Flow chart is done.
[snip, flow chart no longer valid. If you still want to see all my crappy hardwork, it's here]
« Last Edit: January 15, 2014, 09:40:13 PM by Who Cares99 »


-nay-

oh well

it's very complicated
« Last Edit: January 19, 2014, 02:13:38 PM by Fab »


Done.

I might want to add that when you are taken off of the home screen, the "Edit" button in the top right is changed to a "Back" button, and clicking it will follow the arrow you came from in reverse.

What about "Remove Category"?

What about "Remove Category"?
When you double click on a category there's a button to delete it.

Is having a client-sided GUI affect server-sided data not a good idea because the client might be able to edit the client-sided script and bypass the restrictions, or would this be easily avoidable by having a server-sided check on what ID is trying to access certain parts of the GUI?

I'll post a backup plan for the script that wouldn't involve a GUI, which could be implemented into the script so that you don't need to have the mod. It would be a text-only version of the mod. I'll post it once I can get on my computer.
(I share a room with my twin. Both of our computers are in our room, so I can't use mine until he wakes up. 99% of the time, when I post, I'm doing it from my phone.)
« Last Edit: January 18, 2014, 11:09:40 AM by Who Cares99 »


    is this bannable?
    I don't know, but I don't think it really deserves to be banned here because what he said didn't require reading the OP. Therefore I wouldn't report him.


    Chat commands (plan B):
    • /searchID [ID] - Searches for the BL_ID in the database. It says the BL_ID, online status, and tags in the chat for that ID.
    • /listcategories - Lists the tag categories.
    • /createcategory [category name] [default tag] - Creates a category using the name and default tag that you list. (Host only)
    • /removecategory [name] - Removes the category (Host only)
    • /listeditors - Lists everyone with edit rights
    • /granteditrights [ID] - Gives that ID the right to edit the computer. (Host only)
    • /revokeeditrights [ID] - Revokes that ID's right to edit the computer.
    • /edittag [ID] [Category Name] [Tag] - Changes the tag for that ID, in that category, to what you put in the third space.
    « Last Edit: January 18, 2014, 01:38:12 PM by Who Cares99 »

    It is - if I replied to this with a "tl;dr" then I would be banned.

      I think the question was within the drama forum, but if the rule applies to all boards then by the letter of it he broke it. However, I would believe that the rule was made to prevent spam, and because his joke did not require reading the actual OP, I don't think it would be classified as spam. Feel free to report him to moderator though, if you actually feel that it is a spam or otherwise harmful post.

      Also, chat commands (plan B):
      • /searchID [ID] - Searches for the BL_ID in the database. It says the BL_ID, online/offline, and tags in the chat for that ID.
      • /listcategories - Lists the tag categories.
      • /createcategory [category name] [default tag] - Creates a category using the name and default tag that you list. (Host only)
      • /removecategory [name] - Removes the category (Host only)
      • /listeditrights - Lists everyone with edit rights
      • /granteditrights [ID] - Gives that ID the right to edit the computer. (Host only)
      • /revokeeditrights [ID] - Revokes that ID's right to edit the computer.
      • /edittag [ID] [Category Name] [Tag] - Changes the tag for that ID, in that category, to what you put in the third space.
      • /toggleaccess - Toggles whether or not everyone can access the computer. When you type the command, it sends a chat message to the server saying "Access to the computer is now: ["Public or "Restricted"]"
      • /listaccessrights - Lists everyone who has the right to access the computer.
      • grantaccessrights [ID] - Gives that ID the right to access the computer. (Host only)
      • /revokeaccessrights [ID] - Revoke's that ID's right to access the computer
      • /policecomputerhelp - Lists all of the commands above
      If you try to type any of these commands besides /policecomputerhelp and you don't have permission, it says "You don't have permission to do this, sorry."
      If you type a command but it can't find what you are trying to do, for example, if you typed the wrong ID when searching, it says "Sorry, but the computer is unable to find what you are searching for. Please review your command."

      The list of IDs that you can search for is made up of every ID that has ever spawned on the server.
    « Last Edit: January 18, 2014, 11:01:35 PM by Who Cares99 »

    so it's a thing that allows you allow/disallow users from using cars..? or apply arbitrary tags to users.. kind of like vce, but not exactly, right?

    could you give some more examples of how this would be used, please?