Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 2 3 4 5 … 18 Next »
HUD Linked vehicle on TSCM Chairs
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
HUD Linked vehicle on TSCM Chairs
17-01-2021, 10:26 PM,
#1
57e11a Offline
Cheating Donating Member
***
Posts: 198
Threads: 68
Joined: Apr 2019
HUD Linked vehicle on TSCM Chairs
So I'm using a HUD, linked to a TSCM Chair, and I'm trying to add some hooks that will only run on clients when they're sitting in the linked vehicle.

My current code:
if not IsValid(hud.getLinkedVehicle()) or hud.getLinkedVehicle() ~= ents.player():vehicle() then return end
This works for normal chairs, but when using hud.getLinkedVehicle() on a hud that is linked to a TSCM Chair, it returns a prop_vehicle_prisoner_pod, even though the seat is a chair_ghost (and it's an entity, so there's no Vehicle methods/fields)

she/her
Founder of The Anisu Corporation
[Image: iZUefQi.gif]
Find
Reply
17-01-2021, 11:06 PM,
#2
The17thDoctor Online
TSCM Average Enjoyer
****
Posts: 1,100
Threads: 249
Joined: Oct 2015
RE: HUD Linked vehicle on TSCM Chairs
To be clear, everything is an entity, and a vehicle is just a special case of entities. Moreover, when using hud.getLinkedVehicle() I get the chair_ghost and not any prop_vehicle_prisoner_pod.
However the chair_ghost is indeed not considered as a vehicle by Starfall which is kind of problematic.

The17thDoctor: Server take me to the most handsome person
srcds_linux: I cant send people to themselves...
Website Find
Reply
17-01-2021, 11:33 PM,
#3
57e11a Offline
Cheating Donating Member
***
Posts: 198
Threads: 68
Joined: Apr 2019
RE: HUD Linked vehicle on TSCM Chairs
Are you running hud.getLinkedVehicle() on the server or the client?
I'm running it on the client and I'm getting a prop_vehicle_prisoner_pod

she/her
Founder of The Anisu Corporation
[Image: iZUefQi.gif]
Find
Reply
18-01-2021, 04:49 PM,
#4
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: HUD Linked vehicle on TSCM Chairs
Chairs positions aren't vehicles, they behave a bit differently. I've added hud.isLinkedToVehicle( Entity ) which will deal with the difference between chair positions and real vehicles for you, it'll be available after the next restart.
Find
Reply
18-01-2021, 07:49 PM,
#5
57e11a Offline
Cheating Donating Member
***
Posts: 198
Threads: 68
Joined: Apr 2019
RE: HUD Linked vehicle on TSCM Chairs
Thank you! It works great!

she/her
Founder of The Anisu Corporation
[Image: iZUefQi.gif]
Find
Reply
20-01-2021, 05:48 PM,
#6
57e11a Offline
Cheating Donating Member
***
Posts: 198
Threads: 68
Joined: Apr 2019
RE: HUD Linked vehicle on TSCM Chairs
It appears that the hud forgets the linked seat (still linked, but the hud.isLinkedToVehicle function returns false) after duplication

she/her
Founder of The Anisu Corporation
[Image: iZUefQi.gif]
Find
Reply
23-01-2021, 01:46 PM,
#7
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: HUD Linked vehicle on TSCM Chairs
Restoring links after dupe should be fixed after the next restart.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.