Garry's Mod

Garry's Mod

139 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
0.001 MB
Jan 17, 2014 @ 5:25pm
Jun 2, 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] Apr 10, 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 Oct 30, 2019 @ 8:28am 
You still need users and rangers with this addon
Lividsubset3 Oct 29, 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?
[DTC] JapaneseRaindeer Apr 12, 2019 @ 6:30am 
uhhmm could you give a link for a download so we can install it on servers?
shrek wazowski Sep 2, 2018 @ 1:34am 
it says invalid shipment
is this because it doesnt support m9k?
Leevi Aug 10, 2018 @ 4:49pm 
Wire Ranger:entity to Entity on the ranger
Taken Ƹ̵̡Ӝ̵̨̄Ʒ Nov 27, 2017 @ 4:17pm 
it keeps saying Invalid Shipment

@name
@inputs Ranger:entity
interval(1)


if(Ranger:isShipment()){

print(Ranger:shipmentName())
neo Aug 18, 2017 @ 12:56am 
Interested in potentially hiring you to do some custom e2 extensions.
KingOfRand0m Dec 6, 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
notreal May 28, 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))
}