Garry's Mod

Garry's Mod

145 ratings
TylerB's Shipment E2 Functions (v1)
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Roleplay
File Size
Posted
Updated
1.367 KB
17 Jan, 2014 @ 5:25pm
2 Jun, 2018 @ 1:10pm
18 Change Notes ( view )

Subscribe to download
TylerB's Shipment E2 Functions (v1)

In 2 collections by TylerB
boring.builders | BuildRP Content
15 items
boring.builders | Lawless Content
15 items
Description
Ever wanted to make an "intelligent" gun shop? With this addon, you can do many cool things:

IMPORTANT NOTE: Most functions can take either an entity or a string - Entities are the shipment box entity, and strings are either the name of the shipment, or the class of the weapon inside. (e.g weapon_deagle2)


ent:shipmentName() / shipmentName(str) - Returns the name of the shipment. Something like "Pump shotgun".
ent:shipmentType() / shipmentType(str) - Returns the class of the weapon inside. Something like "weapon_ak47".
ent:shipmentSeparate() / shipmentSeparate(str) - Returns whether or not the shipment is available as singles.
ent:shipmentPriceSep() / shipmentPriceSep(str) - Returns the price of the individual gun.
ent:shipmentPrice() / shipmentPrice(str) - Returns the price of the shipment.
ent:shipmentAmount() - Returns the number of weapons remaining in the shipment.
ent:shipmentSize() / shipmentSize(str) - Returns the default number of weapons in the shipment.
ent:shipmentModel() / shipmentModel(str) - Returns the model of the weapon.
ent:isShipment() - Returns whether the entity is a shipment or not. (equivalent to ent:type() == "spawned_shipment")


Have an error to report? Leave a comment below!

Goes well with my moneyRequest() - E2 Functions for DarkRP addon.

Facepunch thread[facepunch.com]
GitHub[github.com]

91 Comments
TylerB  [author] 10 Apr, 2020 @ 7:39pm 
All this script does is expose some useful functions for expression2 - they are to compliment users and rangers, not replace them.
KingOfRand0m 30 Oct, 2019 @ 8:28am 
You still need users and rangers with this addon
Lividsubset3 29 Oct, 2019 @ 8:08am 
This does not work for custom server with custom shipments, is their any work around for this? or do i just have to deal with users and rangers for the time being?
JudgeRinder 12 Apr, 2019 @ 6:30am 
uhhmm could you give a link for a download so we can install it on servers?
tiny hawk 2 Sep, 2018 @ 1:34am 
it says invalid shipment
is this because it doesnt support m9k?
0vector 10 Aug, 2018 @ 4:49pm 
Wire Ranger:entity to Entity on the ranger
Taken Ƹ̵̡Ӝ̵̨̄Ʒ 27 Nov, 2017 @ 4:17pm 
it keeps saying Invalid Shipment

@name
@inputs Ranger:entity
interval(1)


if(Ranger:isShipment()){

print(Ranger:shipmentName())
BinaryNinja 18 Aug, 2017 @ 12:56am 
Interested in potentially hiring you to do some custom e2 extensions.
KingOfRand0m 6 Dec, 2016 @ 4:41am 
Hey man! Sorry to bump... But do this work with all gun packs? I can't seem to get CW2 to show the shipment name when i use shipmentName(), it just gives me the name: spawned_shipment. and the price is not showing aswell
/home/fozie 28 May, 2016 @ 11:58am 
If your getting a invalid shipment error. Just do this
if(Ranger:entity():shipmentName() == "Invalid Shipment"){
EGP:egpText(1,"Out of Stock!",vec2(256))
}
else{
EGP:egpText(1,Ranger:shipmentName(),vec2(256))
}