Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetVehicleSpawnInfo #9

Closed
JernejL opened this issue Jan 6, 2015 · 14 comments
Closed

SetVehicleSpawnInfo #9

JernejL opened this issue Jan 6, 2015 · 14 comments

Comments

@JernejL
Copy link

JernejL commented Jan 6, 2015

Is this possible to add a function to change existing vehicle's spawn info coordinates and have respawnvehicle spawn the vehicle at new place?

@ghost
Copy link

ghost commented Jan 6, 2015

Hm... Look's like yes.

@JernejL
Copy link
Author

JernejL commented Jan 6, 2015

Alright, something like this - i need, will appreciate if it's added.

@ghost
Copy link

ghost commented Jan 7, 2015

Hm...

Looks like set vehicle to new position after SetVehicleToRespawn used is very easy, just need to hook SetVehicleToRespawn. But spawn at new spawn when server respawn the vehicle because respawntime passed, it's harder. (need to hook complete CVehicle::Respawn which I do now want to do)

I have opensamp 0.3x, community should update it to 0.3z and there would be very easy to modify anithing in server :D But i won't do it, i want to live outside of my computer.

https://code.google.com/p/open-samp/source/browse/#svn%2Ftrunk%2FOpen%20SAMP

@JernejL
Copy link
Author

JernejL commented Jan 8, 2015

what about just re-sending the "create vehicle" rpc to override it with new spawn position data?

@ghost
Copy link

ghost commented Jan 8, 2015

You cant override, just create new vehicle

@JernejL
Copy link
Author

JernejL commented Jan 9, 2015

could you create a new vehicle with SAME old id?
Delete old id create vehicle with same old id again on all clients?

@ghost
Copy link

ghost commented Jan 9, 2015

Yes, this is how i imagined the solution.

@JernejL
Copy link
Author

JernejL commented Jan 9, 2015

So, is this feasible? if it did that it would be a winner, because it would keep the same vehicle id on which a lot of code relies.

@ghost
Copy link

ghost commented Jan 9, 2015

Don't worry, this will work. I just need to implement it. I'll do it when i'll have free time.

@JernejL
Copy link
Author

JernejL commented Jan 9, 2015

It will be Awesome!

@oscar-broman
Copy link
Contributor

I saw c0c6d6c but that seems like a lot of unnecessary work. You could just send the RPC to remove the vehicle then send the vehicle spawn RPC with the same vehicle ID and new position parameters.

That, combined with hooking the Pawn native functions for creating vehicles would become a complete solution.

@ghost
Copy link

ghost commented Jan 15, 2015

I want to do that, but I want completly hook CVehicle::Spawn, hook pawn native SetVehicleToRespawn isn't enough..

@BitFros7y
Copy link

Why not just mess with vehicles pool? Just do everything like in GetVehicleSpawnInfo only set new info. Next time vehicle is bound to respawn it should access that memory and respawn it at new coordinates.

Also i have seen there is something implemented already, is it working or? (If it is why not close issue?)

@ghost
Copy link

ghost commented Feb 2, 2016

Maybe this will be in R16 :)

For me it works currently, going to test it soon on live server.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants