Scripting help
#1
Im setting up a darkRP server (dont laugh at me please) and my weapon shipment script broke because i probably did somthing wrong. Anyone know whats wrong with it?

PHP Code:
AddCustomShipment("Desert eagle""models/weapons/w_pist_deagle.mdl""weapon_mad_deagle"010true500false, {TEAM_GUN})
AddCustomShipment("Fiveseven""models/weapons/w_pist_fiveseven.mdl""weapon_mad_57"010 true250false, {TEAM_GUN})
AddCustomShipment("Glock""models/weapons/w_pist_glock18.mdl""weapon_mad_glock"010true150false, {TEAM_GUN})
AddCustomShipment("P228""models/weapons/w_pist_p228.mdl""weapon_mad_p228"010true200false, {TEAM_GUN})

AddCustomShipment("AK47""models/weapons/w_rif_ak47.mdl""weapon_mad_ak47"30005falsenilfalse, {TEAM_GUN}) 
AddCustomShipment("MP5""models/weapons/w_smg_mp5.mdl""weapon_mad_mp5"25005falsenilfalse, {TEAM_GUN}) 
AddCustomShipment("M4""models/weapons/w_rif_m4a1.mdl""weapon_mad_m4"30005falsenilfalse, {TEAM_GUN}) 
AddCustomShipment("TMP""models/weapons/w_smg_tmp.mdl""weapon_mad_tmp"25005falsenilfalse, {TEAM_GUN}) 
AddCustomShipment("M3 Super""models/weapons/w_shot_m3super90.mdl""weapon_mad_m3"27505falsenilfalse, {TEAM_GUN}) 
AddCustomShipment("M4 Super""models/weapons/w_shot_xm1014.mdl""weapon_mad_xm1014"35005falsenilfalse, {TEAM_GUN}) 

AddEntity("Drug lab""drug_lab""models/props_lab/crematorcase.mdl"4003"/buydruglab", {TEAM_GANGTEAM_MOB})
AddEntity("Money printer""money_printer""models/props_c17/consolebox01a.mdl"10002"/buymoneyprinter")
AddEntity("Microwave""microwave""models/props/cs_office/microwave.mdl"4001"/buymicrowave"TEAM_COOK)
AddEntity("Gun lab""gunlab""models/props_c17/TrapPropeller_Engine.mdl"5001"/buygunlab"TEAM_GUN)

/*
How to add custom vehicles:
FIRST
go ingame, type rp_getvehicles for available vehicles!
then:
AddCustomVehicle(<One of the vehicles from the rp_getvehicles list>, <Model of the vehicle>, <Price of the vehicle>, <OPTIONAL jobs that can buy the vehicle>)
Examples:

Add those lines under your custom shipments. At the bottom of this file or in data/CustomShipments.txt

HOW TO ADD CUSTOM SHIPMENTS:
AddCustomShipment("<Name of the shipment(no spaces)>"," <the model that the shipment spawns(should be the world model...)>", "<the classname of the weapon>", <the price of one shipment>, <how many guns there are in one shipment>, <OPTIONAL: true/false sold seperately>, <OPTIONAL: price when sold seperately>, < true/false OPTIONAL: /buy only = true> , OPTIONAL which classes can buy the shipment, OPTIONAL: the model of the shipment)

Notes:
MODEL: you can go to Q and then props tab at the top left then search for w_ and you can find all world models of the weapons!
CLASSNAME OF THE WEAPON
there are half-life 2 weapons you can add:
weapon_pistol
weapon_smg1
weapon_ar2
weapon_rpg
weapon_crowbar
weapon_physgun
weapon_357
weapon_crossbow
weapon_slam
weapon_bugbait
weapon_frag
weapon_physcannon
weapon_shotgun
gmod_tool

But you can also add the classnames of Lua weapons by going into the weapons/ folder and look at the name of the folder of the weapon you want.
Like the player possessor swep in addons/Player Possessor/lua/weapons You see a folder called weapon_posessor 
This means the classname is weapon_posessor

YOU CAN ADD ITEMS/ENTITIES TOO! but to actually make the entity you have to press E on the thing that the shipment spawned, BUT THAT'S OK!
YOU CAN MAKE GUNDEALERS ABLE TO SELL MEDKITS!

true/false: Can the weapon be sold seperately?(with /buy name) if you want yes then say true else say no

the price of sold seperate is the price it is when you do /buy name. Of course you only have to fill this in when sold seperate is true.


EXAMPLES OF CUSTOM SHIPMENTS(remove the // to activate it): */

//AddCustomShipment("HL2pistol", "models/weapons/W_pistol.mdl", "weapon_pistol", 500, 10, false, 200, false, {TEAM_GUN, TEAM_MEDIC})

--EXAMPLE OF AN ENTITY(in this case a medkit)
--
AddCustomShipment("bball""models/Combine_Helicopter/helicopter_bomb01.mdl""sent_ball"10010false10false, {TEAM_GUN}, "models/props_c17/oildrum001_explosive.mdl")
--
EXAMPLE OF A BOUNCY BALL:           NOTE THAT YOU HAVE TO PRESS E REALLY QUICKLY ON THE BOMB OR YOU'LL EAT THE BALL LOL
--AddCustomShipment("bball", "models/Combine_Helicopter/helicopter_bomb01.mdl", "sent_ball", 100, 10, true, 10, true)
-- ADD CUSTOM SHIPMENTS HERE(next line): 

Please tell me or show me how to fix it. Would be much appreciated!!!
#2
Errr, what?
#3
Made sure you didn't make any spelling errors etc.?

Otherwise, need someone with coding experience for it, sorry.
#4
Why does it say PHP code? You don't use PHP to script Lua?
[Image: h2.png]
Visit my profile here.
#5
What does your console throw at you when you try it?
FUMUKU
WAS THE BEST THING TO EVER HAPPEN TO FEARLESS RP


UNBAN BLACKDOG
#6
(07-28-2012, 05:34 PM)Midget Wrote: Why does it say PHP code? You don't use PHP to script Lua?

PHP Code:
Its just a Forum thing to make it look cool.. 
The following 1 user Likes Nevy's post:
  • TheDeadPixel
#7
(07-28-2012, 05:35 PM)Aoixification Wrote: What does your console throw at you when you try it?

It doesnt say anything at all. I cant find any special messages in the console
#8
Contact Temar Cheese
He is the expert about this kind of case!
[Image: JmCzDqB.png]
#9
This is more like advertising.
<3<3 I will never forget you grandfather 14.9.11 R.I.P<3<3

#10
I smell advertisement


Forum Jump:


Users browsing this thread: 1 Guest(s)