Vice City: Multiplayer

VC:MP Discussion => Support => Topic started by: Fuzzie on Jan 11, 2015, 07:29 AM

Title: Vehicle.SetGhost (and to a certain extent, Vehicle.GetGhost)
Post by: Fuzzie on Jan 11, 2015, 07:29 AM
What happened to Vehicle.SetGhost? It's not in the wiki but it is in the source code. Does it also have anything to do with making this (http://youtu.be/Evh_RvG9ti8) possible? If no, then how do I achieve what storm did and what Vehicle.SetGhost was suppose to do?
Title: Re: Vehicle.SetGhost (and to a certain extent, Vehicle.GetGhost)
Post by: Sebastian on Jan 11, 2015, 10:26 AM
Did you even try that function ?
You didn't, because if you would have tried it you would have know that it works just like Stormeus shown in his video.

About the wiki... it is very uncomplete. When I will have more free-time, I will try to complete it as much as I can.
Title: Re: Vehicle.SetGhost (and to a certain extent, Vehicle.GetGhost)
Post by: Fuzzie on Jan 11, 2015, 10:40 AM
I wouldn't have made this topic if I haven't already tried it out already. So accusing me of not trying is probably not wise. My code was very simple. player.Vehicle.SetGhost( true ); I got an error message saying that SetGhost() isn't a member variable of Vehicle. That and the fact it wasn't in the wiki lead me to believe something happened with it.
Title: Re: Vehicle.SetGhost (and to a certain extent, Vehicle.GetGhost)
Post by: Danix on Jan 11, 2015, 01:58 PM
Try this:
player.Vehicle.IsGhost=true;
Title: Re: Vehicle.SetGhost (and to a certain extent, Vehicle.GetGhost)
Post by: . on Jan 11, 2015, 02:15 PM
Quote from: Danix on Jan 11, 2015, 01:58 PMTry this:
player.Vehicle.IsGhost=true;

You shouldn't chain anything on player.Vehicle because it might return null. Make sure to at least check before doing that.
if (player.Vehicle != null) player.Vehicle.IsGhost=true;
Title: Re: Vehicle.SetGhost (and to a certain extent, Vehicle.GetGhost)
Post by: Danix on Jan 11, 2015, 02:27 PM
Quote from: S.L.C on Jan 11, 2015, 02:15 PM
Quote from: Danix on Jan 11, 2015, 01:58 PMTry this:
player.Vehicle.IsGhost=true;
You shouldn't chain anything on player.Vehicle because it might return null. Make sure to at least check before doing that.
if (player.Vehicle != null) player.Vehicle.IsGhost=true;
I am indeed aware of that, but he asked for the correct usage, not the whole code.
Title: Re: Vehicle.SetGhost (and to a certain extent, Vehicle.GetGhost)
Post by: MatheuS on Jan 11, 2015, 02:34 PM
FindVehicle(ID).IsGhost=true/false;

FindVehicle(1).IsGhost=true;
Title: Re: Vehicle.SetGhost (and to a certain extent, Vehicle.GetGhost)
Post by: Fuzzie on Jan 11, 2015, 03:22 PM
Thanks to everyone who helped but a guy already told me on my server. Still, thanks though.

@S.L.C: I was just testing some feature so I didn't include some of the usual checking stuff. :P
Title: Re: Vehicle.SetGhost (and to a certain extent, Vehicle.GetGhost)
Post by: . on Jan 11, 2015, 03:47 PM
I was just pointing that out. You never know when a newbie will come around and use that code without knowing.
Title: Re: Vehicle.SetGhost (and to a certain extent, Vehicle.GetGhost)
Post by: DizzasTeR on Jan 23, 2015, 10:37 AM
Thanks to Fuzzie, you saved a hell of codes to be implemented in my script which I'm working on by just showing me this function and that video.