Posts: 1,266
Threads: 6
Joined: Oct 2014
O.O, Simple but nice D:, Keep the good work
.
Posts: 229
Threads: 5
Joined: Sep 2015
Reputation:
0
@SecretBoss & Gammix: Both of your statements make no-sense.
The whole point in hooking "LinkVehicleToInterior()" is to be able to use the native function while allowing extra executions to be performed at the same instance, and without having to edit existent usages of the function itself. In this case, it's saving the vehicle's interior ID in a variable then linking the vehicle to the specified interior ID (by returning the native function and not the hook), so that we can create a new function that returns the vehicle's interior ID (GetVehicleInteriorID()) as it is needed when a player spectates a player that's driving a vehicle.
In brief, you don't use "Hook_LinkVehicleToInterior()", but "LinkVehicleToInterior()".
I added a note to the main post.
Thanks guys.
Posts: 1,773
Threads: 47
Joined: Jan 2015
Reputation:
0
Nevermind, but you didn't understand that you can directly use Hook_LinkVehicleToInterior instead of hooking.
But, i wonder why would anyone check for vehicle interior ids, if the spectate system is based on players. What happens if i change the interiorid from my gamemode, your hooking is just trash. You don't need to store vehicles interiorids but only use GetPlayerInterior and OnPlayerInteriorChange.
Posts: 1,773
Threads: 47
Joined: Jan 2015
Reputation:
0
You don't stop or advance spectate when the player disconnects, dies.
You would also require to check for virtual worlds, and that would require you to make checks under OnPlayerUpdate (for script compatibility with others).
There are several more things a spectate system should have, but since you script basics, i won't argue on this.
Posts: 9
Threads: 0
Joined: Oct 2015
Simple,and nice.