Adding a Custom map for ARP

This guide is mostly done, please update it with what you like, but please make sure that what you add is correct and you have tested it.
==Setting up required files==
Apollo RP has both a MySQL and files on the server.
First we will do the server files:
Each map has its own files, these are located:
ts/addons/amxmodx/configs/arp/
In here you will find folder with map names. Since we are making a new map config.
Create a new folder with the name of your map.
e.g. /addons/amxmodx/configs/arp/maps/randomtown_v4/
Now in this folder you will need 3 files:
jailmod.ini
rob.ini
npcs.ini
These are really easy to make:
1. just open notepad
2. then go on Save As
3. chose where to save to
4. change the file name to jailmod.ini (make sure it does NOT say .txt on the end)
5. repeat with rob.ini and npcs.ini
===Adding NPC's===
----
Now we can add npc's to your map.
There are 5 types of npc's:
shop
doctor
gunshop
bank
atm
note, for any changed to take place the server must restart or map change.
====Setting up Shop====
----
Shops must have these lines at the top:
type "shop"
name "Randomz Guy"
model "models/mecklenburg/chef.mdl"
angle "0"
origin "1186 1022 -11"
Now I'll break it down for you:
type "shop"
we want this type of shop, this is for normal NPC's that sell items.
name "Randomz Guy"
This is the name of your shop change this to what ever you want.
model "models/mecklenburg/chef.mdl"
This is what the NPC will look like. Change this to what you want but make sure the file path is correct.
angle "0"
This with spin the guy round to face which direction you want him to.
(360 and 0 will be the same direction)
(I recommend using either 0, 90, 180, or 270 and if that's not right then try 45, 135, 225, or 315)
origin "1186 1022 -11"
This is where the NPC is. In the X Y Z format.
(As an admin, use the teleport menu, save your location with 8. then change "current location" to "to location" this now give the x y z of where you where)
Now on the next lines you add the items you want in the NPC.
sell "Cigarette 10"
sell "Cuban_Cigar 20"
sell "Tobacco_Pipe 30"
sell "Lighter 10"
sell "Zippo 50"
sell "Spray_Can 50"
its works like:
sell "Item_name price"
If items have a space in there name replace it with '_' (underscore).
To get a list of items on your server type 'arp_itemlist' into your console.
Then to show that there is nothing else to add to this NPC you have to add [END] on the last line.
Here is a example of a fully working NPC:
type "shop"
name "Randomz Guy"
model "models/mecklenburg/chef.mdl"
angle "0"
origin "1186 1022 -11"
sell "Cigarette 10"
sell "Cuban_Cigar 20"
sell "Tobacco_Pipe 30"
sell "Lighter 10"
sell "Zippo 50"
sell "Spray_Can 50"
[END]
=====Setting up Shop with rob=====
----
Now you can add the 'rob' function to any 'shop' NPC.
To do this you must add the line:
robprofile "Randomz"
before the [END]
robprofile "Randomz"
You can rename this to anything you want, i chose randomz cos its similar to the NPC's name so I don't get mixed up.
Here is a example of a "robable" NPC:
type "shop"
name "Randomz Guy"
model "models/mecklenburg/chef.mdl"
angle "0"
origin "1186 1022 -11"
sell "Cigarette 10"
sell "Cuban_Cigar 20"
sell "Tobacco_Pipe 30"
sell "Lighter 10"
sell "Zippo 50"
sell "Spray_Can 50"
robprofile "Randomz"
[END]
Now we have to open rob.ini (All the rob setting are here)
This is how a rob is set out:
[Randomz]
; Settings
cashsecond 5
cashmax 100
stopon 15
cooldown 60
arrestedend "#name# has been arrested while robbing the Randomz Guy!"
killedend "#name# has been killed while robbing the Randomz Guy!"
leaveend "#name# has left the Randomz Guy while robbing!"
doneend "#name# has taken all of the money from the Randomz Guy!"
start "#name# is robbing the Randomz Guy!"
minplayers 3
mincops 1
flags a
radius 200
origin " -1331 2185 44"
; Script
!sound arp/alarm.wav
!glow "255 0 0"
!lights "255 0 0 20 1 20"
!wait 3
!lights "255 0 0 20 1 20"
!wait 3
!lights "255 0 0 20 1 20"
!wait 3
!lights "255 0 0 20 1 20"
!glow "0 0 255"
@!glow "0 0 0"
Now let me explain each bit:
[Randomz]
This is at the top. It must be the same as the robprofile from the npc.
; Settings
this is ignored because it has ; at the start, this makes it look nicer but also useful for notes.
cashsecond 5
This is how much cash is taken while robbing per second.
cashmax 100
This is the maximum cash that can be robbed per robbing.
stopon 15
This i dont know ill add when i know what.
cooldown 60
This is the time after the last robbery before it can be robbed again.
arrestedend "#name# has been arrested while robbing the Randomz Guy!"
This is the message said when the robber is arrested
killedend "#name# has been killed while robbing the Randomz Guy!"
This is the message said when the robber dies
leaveend "#name# has left the Randomz Guy while robbing!"
This is the message said then the robber steps away from the npc
doneend "#name# has taken all of the money from the Randomz Guy!"
This is the message said when all the money has been taken
start "#name# is robbing the Randomz Guy!"
This is the message to say that the npc is being robbed.
(note #name# is replaced with the robbers name)
minplayers 3
This is how meny players are needed on the server before you can rob
mincops 1
This is how meny cops are needed on the server before you can rob
flags a
Anyone with this flag(s) can not rob this npc
e.g. cops have a flag, doctors have b flag and shop workers have s flag.
flags "abs"
Now anyone with flag, a, b, s can not rob this npc.
radius 200
The area arround the npc where you can rob, leave this area and you stop robbing
origin " -1331 2185 44"
This is the origin of the npc
; Script
!sound arp/alarm.wav
!glow "255 0 0"
!lights "255 0 0 20 1 20"
!wait 3
!lights "255 0 0 20 1 20"
!wait 3
!lights "255 0 0 20 1 20"
!wait 3
!lights "255 0 0 20 1 20"
!glow "0 0 255"
@!glow "0 0 0"
This is what happens when you rob
the ! means it will happen on the start of rob
the @! means it will happen at the end of rob
I can't really explain this bit because you can set it to whatever you want.
This is what it is by default.
note, if you glow some one dont forget to unglow then when they finished robbing.
Here are the available command with rob:
WAIT,
USE,
EFFECTS,
MESSAGEONE,
MESSAGEALL,
END,
LOCK,
UNLOCK,
GLOW,
LIGHTS,
SOUND
I recommend you to experiment!
Now you have set up rob for your npc!
====Setting up Doctor====
----
These are not so different from 'shop'
type "doctor"
name "Doctor"
model "models/Nirvanna/npcs/npcs_nmd.mdl"
angle "90"
origin "-2433 1320 -75"
; This is the healing param
sell "!heal 100"
sell "First_Aid_Kit 200"
[END]
The healing paramaiter adds to the shop 'Heal me'
ToDo:What !heal does.
====Setting up Gunshop====
----
This is the biggest section but it is very easy. Here:
This runs the same as shop but its addgun not sell.
Remember ; mean the line is ignored, easy way to remove guns
There are two, the first has 'zone' below its origin the other doesn't.
The one with 'zone' is the area where the person buys the gun. (where you stand)
The one without is the npc. (where it stands)
Easy job copy and paste then get origins.
type "gunshop"
name "Gun Shop"
model "models/mecklenburg/chef.mdl"
angle "270"
origin "136 -480 -139"
zone
addgun "glock-18 1000 0"
addgun "uzi 1500 0"
addgun "m3 2000 1"
addgun "m4a1 3000 1"
addgun "mp5sd 2500 1"
addgun "mp5k 1800 0"
addgun "beretta 1000 0"
addgun "mk23 600 0"
addgun "usas 3000 1"
addgun "desert 750 0"
;addgun "ak-47 3500 1" ; Prohibited
addgun "five-seven 400 0"
addgun "aug 3300 1"
addgun "tmp 1200 0"
;addgun "m82a1 5000 1" ; Prohibited
addgun "mp7 1600 0"
addgun "spas 1800 1"
addgun "golden 1200 0"
;addgun "contender 2000 1" ; Prohibited
addgun "glock-20 800 0"
addgun "ump 1500 0"
;addgun "m61 1000 1" ; Prohibited
addgun "combat 100 0"
addgun "mossberg 1000 0"
addgun "m16a4 2500 1"
addgun "mk1 250 0"
addgun "raging 1600 1"
;addgun "m60 4000 1" ; Prohibited
;addgun "sawed-off 500 1" ; Prohibited
addgun "katana 200 0"
addgun "seal 150 0"
addgun "permitted 2000 2"
addgun "restricted 10000 2"
[END]
type "gunshop"
name "Gun Shop"
model "models/mecklenburg/chef.mdl"
angle "180"
origin "79 -463 -139"
addgun "glock-18 1000 0"
addgun "uzi 1500 0"
addgun "m3 2000 1"
addgun "m4a1 3000 1"
addgun "mp5sd 2500 1"
addgun "mp5k 1800 0"
addgun "beretta 1000 0"
addgun "mk23 600 0"
addgun "usas 3000 1"
addgun "desert 750 0"
;addgun "ak-47 3500 1" ; Prohibited
addgun "five-seven 400 0"
addgun "aug 3300 1"
addgun "tmp 1200 0"
;addgun "m82a1 5000 1" ; Prohibited
addgun "mp7 1600 0"
addgun "spas 1800 1"
;addgun "contender 2000 1" ; Prohibited
addgun "golden 1200 0"
addgun "glock-20 800 0"
addgun "ump 1500 0"
;addgun "m61 1000 1" ; Prohibited
addgun "combat 100 0"
addgun "mossberg 1000 0"
addgun "m16a4 2500 1"
addgun "mk1 250 0"
addgun "raging 1600 1"
;addgun "m60 4000 1" ; Prohibited
;addgun "sawed-off 500 1" ; Prohibited
addgun "katana 200 0"
addgun "seal 150 0"
addgun "permitted 2000 2"
addgun "restricted 10000 2"
[END]
====Setting up Bank====
----
The banker is a small NPC in this file.
It also runs like the gunshop and shop.
They have two parts for each NPC, but they can be robbed as well.
To set up rob follow the (#1.1.1.1.) Setting up Shop with rob.
Remember zone is where you stand the other is where the npc stands.
Also notice with most the origins with have to the same co-ordinates.
In this example the X and Z co-ordinates are the same:
origin "70 884 -107"
origin "70 803 -107"
type "bank"
name "Bank Teller"
model "models/mecklenburg/banker.mdl"
angle "90"
origin "70 884 -107"
robprofile "bank"
[END]
type "bank"
name "Bank Teller"
model "models/mecklenburg/banker.mdl"
angle "90"
origin "70 803 -107"
zone
robprofile "bank"
[END]
====Setting up ATM====
----
This being the smallest script in this file, atm dont need editing except for its origin.
type "atm"
name "ATM Machine"
model "models/pellet.mdl"
angle "0"
origin "-25, -1770, -139"
zone
[END]
They all have 'zone'
==1.2. Setting up Jail Mod==
This is a quick section.
Each jail location is made up of three parts:
[Jail One]
This is the name on the menu
origin "2765 384 124"
This is where they are teleported to
command "1"
Which number in the jail menu
And that's it!
Here are examples:
[Jail Two]
origin "2588 214 124"
command "2"
[Jail Three]
origin "2413 361 124"
command "3"
[Interrogation Room]
origin "2451 441 284"
command "4"
==2. MySQL==
In this section I will tell you how to add jobs and doors.
There are two ways that I know:
Ingame with (Hawks)
Manually in the MySQL with (fennec)
===Adding Property===
----
Property's are what all the info of one building goes.
Doors are kept seperate and are linked to a keywork known as the 'internal' name.
So its easyer to change doors of a property but keep all the info saved.
====Property Ingame (Hawks)====
----
There are 2 parts to doing this;
The first command is:
arp_addproperty <internalname> <externalname> <owner> <authid> <price> <lock> <access> <profit>
This sets up the property, you link doors to ints internalname with another command later.
<internalname>
tag used to link to doors
<externalname>
the name as it is to appear for users looking at a door linked to the property
<owner>
the name of the owner
<authid>
the authid of the owner
<price>
how much it is to be sold for (0 to indicate not for sale)
<lock>
whether or not to lock it (0 or 1), best to lock buildings so "1"
<access>
what access flags should have access to it
<profit>
how much profit it has to start with, recomended "0"
Here is an example:
arp_addproperty "diner" "The Classy Diner" "" "" "60000" "1" "d" "0"
This means i link the doors to "diner"
The name is "The Classy Diner"
It has no owner so ""
It has no owner so there is no id so ""
Im selling it for $60,000 so "60000"
The doors are locked so "1"
People with job flag "d" get access
It started with no profit so "0" (when profit is made it goes up)
====Property Manually In Mysql (fennec)====
----
My way is basicly open up the mysql database, then open arp_property 
Then just add the property, here are examples of how the table looks like:
Example #	internalname	externalname 	ownername	ownerauth	price	locked	access	profit
Example 1	diner 	The Classy Diner	 	 	60000	1 	d 	0
Example 2	711 	7-11 	 	 	80000	1 	e 	0
===Adding Doors===
----
====Doors Ingame (Hawks)====
----
To add doors ingame you go up to the door and type into the console:
arp_adddoor <internalname>
Where the intername is that same as the internal name that you want to link it to.
Done.
====Doors Manually In Mysql (fennec)====
----
In the Mysql open the arp_doors table.
Now you add each door like this:
Example #	targetname 	internalname
Example 1	t|dinerdoor1	diner
Example 2	t|flat1_door	flat1
===Adding Jobs===
----
====Jobs Ingame (Hawks)====
----
To add a job ingame type into the console:
arp_addjob <name> <salary> <access>
e.g. arp_addjob "hobo" "15" "t"
====Jobs Manually In Mysql (fennec)====
----
Open the arp_jobs table and add each job like:
Example #	name 	salary	access
Example 1	pizzaboy	15 	t
Example 2	hobo 	15 	t
Category:Articles