• Force Respawn Where you Die
    4 replies, posted
So, I've got a few questions, I have a Revival addon https://steamcommunity.com/sharedfiles/filedetails/?id=609567300 And In Singleplayer If I die I get revived at the exact point I die, However in Multiplayer (I am currently using DarkRP, if that gives off some insight or some help in any way) Whenever my users are revived they are re-spawned at the world spawn or job spawn, I'd like to know if one of two things are possible A. Is there any lua code I could put somewhere (other then autorun/server, because it doesn't activate the luascript by default, (probably a way to do this but Idk how) that would force a player to respawn where they die, or Or B. is there something I can do with the addon if I was to decompile it, and add a bit of code in so that if the user is revived only then they would re-spawn at their death spot (I.E -> User dies but isn't revived, Re-spawns at a fixed job spawn, but if the user is revived, They re-spawn where they were revived/died To Make this as easy as I can for getting a correct answer, I heavily prefer the option of B instead of A. I would only want to use option A if and only if it is the only option, I am not very good at lua, so a simple answer dumbed down would be really appreciated
Also, If you can link me to another page or setup that could probably give me some answer as to how to force DarkRP to allow users to respawn on their death point, that would be greatly thanked
To start, I would suggest testing this addon in a gamemode other than DarkRP, as DarkRP has a native respawning system for jobs, and such. If you determine that DarkRP is the cause of the issue, I may have a solution. It generally isn't advisable to edit the DarkRP core files, due to various reasons; however, since there are no settings to disable the native spawning system, as far as I know, this must be done. If you have a text editor such as Sublime Text, search the DarkRP gamemode files for the hook PlayerSpawn. When you find a function related to this hook, comment it out, and proceed with testing the reviving addon. I hope this helps!
Touch DarkRP core files --> Fail to get updates --> Find an issue in your server --> Realize it was fixed in an update you didn't get because your server couldn't update. Method A is very possible. When a player dies, set a variable with their position, and when the player spawns, set their position to that variable. Method B is also very possible, and is basically the same as method A, but you'd have to do a bit more poking around yourself.
Where would I put the lines of code, and what would they be? I'd rather not touch core files but dark rp always seems to work for me now and I've never had an issue with it, all I use it for is Jobs and such?
Sorry, you need to Log In to post a reply to this thread.