Welcome to the thread for 5M Cops and Robbers (henceforth 5MCNR, or ‘CNR’)
About the Gamemode
5M:CNR is a gamemode I’ve been working on that I had intended to open a server for. However, because of the scale of the project and my commitment to University and my family (yay, father of two), I’ve decided it’s in the best interest for myself and the community to release my gamemode as an open source project.
CNR is loosely based on everyone’s old favorite “Crazybob’s Cops and Robbers” on SA:MP. You are an innocent civilian in the GTA V online world, who can do whatever the script allows you to do. Commit crimes, and you will become wanted. Join the police force, and go after wanted persons. If you rather avoid all the trouble altogether, you can just go fishing or do deliveries and avoid the law.
How the gamemode Works
Players join the server, and upon first connection, design their character (currently, due to time restrictions, players currently pick a random Ped Model, freemode models coming soon). When a player connects for the first time, they’re randomly spawned at any number of spawn points in the active zone. The active zone is the portion of the map where crimes can be committed, and missions can be obtained. This is to keep everyone in a similar area. The zone changes every 4 hours, whether there are players connected or not.
Players can then either obtain legal employment by delivering packages, fishing, hunting, or more. If players wish to make more money or get involved with the cops, they can commit crimes and do illegal jobs. Players can also join the police force, and go after wanted players. The rest of the gamemode is in development. Currently you can rob convenience stores, become a cop, or random things you can typically do in unscripted servers.
CURRENT CONTROLS
- (F2) -> Arrests/Tickets the nearest player. (In the future, you will subdue players by tackling or tasing them. F2 will be the button for issuing tickets).
- (E) -> E is the go-to interaction key. Starting work, picking up equipment, etc.
- Starting Robberies: Point a gun. For now, you will need a trainer to give yourself a gun.
Github / Gamemode Development
5M CNR is an Open Source, community game mode as of this point. What this means, is that while I still own the repository, I have opened it up to forking. You can create your own fork, work on the gamemode/optimize things I have written, or even write new features for the gamemode and submit a pull request to have your branch merged into the official gamemode.
If you do not know how to fork/pull/push/pull-request, please see the bottom of this thread.
Standalone Gamemode
The intention is to have this gamemode self-served. Meaning, it will not rely on base resources, or other resources to operate. However, due to time restrictions and current development, it does require SQL integration, spawnmanager, and other base resources. By the time Version 1.0 is released, the game mode will handle all natives and behaviors on it’s own.
GitHub https://github.com/rhapidfyre/Cops-n-Robbers
Anyone can fork and submit pull requests at any time. I will review your modifications to the script, and will merge appropriately.
Existing Code
I realize that my code may not be the best written… Originally, I was making this game mode for self-serving interests, and selfishly operating a game server, being the sole community running this game mode. I decided that, with the pluthera of Roleplay servers available and not many other options, to make this a community effort to make not only a new game mode, but the best game mode that can be offered. When I decided to make this game mode open source, I began to convert things into a more easily readable format. This included using coding conventions, adding function headers, organizing files… Administrative stuff that does not include going back through all 30+ files and revising my pre-alpha code. If you find things that are inefficient, such as loops that don’t make sense, or natives that are obsolete, you are more than welcome to revise them and submit a pull request.
TL;DR - I have been doing a lot of administrative changes, and haven’t touched the code too recently. It’s a mess, but we’ll get there together.
Current Development/Plans
Currently, we are at a crossroad. The base game works. Players can be charged with crimes, arrested by the cops, thrown in jail, and release when their time is up. However, there isn’t much to do yet. Players can’t own vehicles, can’t own apartments, can’t buy clothes, use the Freemode model, do any jobs, fish, hunt, buy guns, find pickups around the map, etc. There are a lot of features missing, and a lot of potential for this to go somewhere.
How to Fork / Pull / Push
First thing you will need to do to assist with the project is to make an account at Github. Once you are logged in, you will go to the main repository page, and at the top right click “Fork”. Create a new fork, and then clone your fork to your local machine, and start coding!
As you code, you can push files to your fork without affecting the main branch, where you can troubleshoot and even add collaborators to YOUR fork to help. Once you have a stable version you would like to have added to the master branch, or your contribution has been finished, you should add any relevant information such as a README file, update the existing README file, and comment any necessary fields. If you a re editing an existing resource, be sure to add yourself to the Contributor list in the __resource.lua
file.
Last but not least, when all your changes are finished, when your edits are stable (they do not have to be final/finished, but they must be error/conflict free), you go to the main repository for the project (not your fork), and submit a pull request. Fill out the relevant info, and then myself or a project Collaborator will review the changes.