MrSisterFister 4 Posted September 25, 2018 Hi Guys Sorry if this is in the wrong section, but does anyone know what i need to change to make a dead body and its loot despawn very fast like 30 seconds from them dying? Again sorry if this cannot be answered here. Share this post Link to post Share on other sites
MrSisterFister 4 Posted September 25, 2018 Never mind i found it! Share this post Link to post Share on other sites
Funkdoc 46 Posted September 25, 2018 pls consider that u are member of a forum where u can give/get help to/from others and to give your solution free to all others finding this thread in the future. thnx Share this post Link to post Share on other sites
Guest Posted September 26, 2018 15 hours ago, MrSisterFister said: Never mind i found it! Mmm... Could you at least show us how to change this? :) Share this post Link to post Share on other sites
Jacob_Mango 33 Posted September 27, 2018 (edited) This is you MrSisterFister... https://xkcd.com/979/ If you ask for help and then figure something out, maybe I don't know, uh, share that knowledge? if you won't, then don't bother asking for help. Gave you the benefit of the doubt, you could've gone to sleep, who knows. But it's now been over 24 hours and you have not shared any information. For those that still want to know, you would have to have to override the 'OnClientRespawnEvent' function in missionServer.c and just use 'GetGame().ObjectDelete( player )' where player is one of the parameters of the overridden function. Edited September 27, 2018 by Jacob_Mango 1 1 Share this post Link to post Share on other sites
Sentepu 7 Posted September 27, 2018 You can also check the CallLater function to get rid of the bodies after some time. Share this post Link to post Share on other sites
GhostIeader 0 Posted September 27, 2018 12 hours ago, Jacob_Mango said: For those that still want to know, you would have to have to override the 'OnClientRespawnEvent' function in missionServer.c and just use 'GetGame().ObjectDelete( player )' where player is one of the parameters of the overridden function. Where is missionServer.c located? Share this post Link to post Share on other sites
Sentepu 7 Posted September 27, 2018 Check this video to get a proper mod installation. Then you can unpbo the files in dta/scripts and get some examples over there, like missionServer.c and a bunch of other files. Share this post Link to post Share on other sites
GhostIeader 0 Posted September 27, 2018 (edited) Found the file- so what's the proper way to modify this function to change the time before despawn? void OnClientRespawnEvent(PlayerIdentity identity, PlayerBase player) { if(player) { if (player.IsUnconscious() || player.IsRestrained()) { player.SetHealth("", "", 0.0); } } } Edited September 27, 2018 by GhostIeader Share this post Link to post Share on other sites
GrosTon1 26 Posted September 28, 2018 On 27/09/2018 at 7:06 AM, Jacob_Mango said: This is you MrSisterFister... https://xkcd.com/979/ If you ask for help and then figure something out, maybe I don't know, uh, share that knowledge? if you won't, then don't bother asking for help. Gave you the benefit of the doubt, you could've gone to sleep, who knows. But it's now been over 24 hours and you have not shared any information. For those that still want to know, you would have to have to override the 'OnClientRespawnEvent' function in missionServer.c and just use 'GetGame().ObjectDelete( player )' where player is one of the parameters of the overridden function. Thank you Jacob for pointing that out, but it doesn't work. Are you sure PlayerBase class represent the player "world object" ? Tried by both overriding the method in init.c and directly with unpacked scripts in missionServer.c. Share this post Link to post Share on other sites
Sentepu 7 Posted September 29, 2018 (edited) yes it works in playerbase, but to be sure the body will be deleted (imagine he doesnt respawn and rage quit) i've done this cleanup into the `EEKilled` method Edited September 29, 2018 by Sentepu Share this post Link to post Share on other sites
SilvioDoHOTS 1 Posted October 1, 2018 Which file it is this method, @Sentepu? Share this post Link to post Share on other sites
Sentepu 7 Posted October 1, 2018 playerbase like i said just above oO Share this post Link to post Share on other sites
SilvioDoHOTS 1 Posted October 1, 2018 On 28/09/2018 at 1:12 PM, GrosTon1 said: Thank you Jacob for pointing that out, but it doesn't work. Are you sure PlayerBase class represent the player "world object" ? Tried by both overriding the method in init.c and directly with unpacked scripts in missionServer.c. You can override on Inic.c, but you need to call this way: override void OnClientRespawnEvent(PlayerIdentity identity, PlayerBase player) { // note: player is now killed in db right after the actual kill happens /*if (GetHive() && player) { GetHive().CharacterKill(player); }*/ if(player) { if (player.IsUnconscious() || player.IsRestrained()) { // kill character player.SetHealth("", "", 0.0); } } // DELETE THE CORPSE AFTER RESPAWN GetGame().ObjectDelete(player); } Share this post Link to post Share on other sites
JohnnyBravo2014 5 Posted October 9, 2018 I know this thread is for making the bodies despawn really quickly, but how would I go about of making them despawn like an hour later? Share this post Link to post Share on other sites
mastaZz 0 Posted October 18, 2018 @SilvioDoHOTS how to make sure that what was in the hands is also lost? override void OnClientRespawnEvent(PlayerIdentity identity, PlayerBase player) { // note: player is now killed in db right after the actual kill happens /*if (GetHive() && player) { GetHive().CharacterKill(player); }*/ if(player) { if (player.IsUnconscious() || player.IsRestrained()) { // kill character player.SetHealth("", "", 0.0); } } // DELETE THE CORPSE AFTER RESPAWN GetGame().ObjectDelete(player); } Share this post Link to post Share on other sites
MrSisterFister 4 Posted October 22, 2018 (edited) Sorry never got any notifications of reply's, and i was busy creating my own server, i didn't even come back to look at post, them went on holiday! Also i have a real life... if you wanna know anything "Kill feeds", "Active Player Counts", "Kill Streaks", "Dead Body Cleanup" etc PM me, or add me on steam (same username and icon) or Discord.. I also created a random death messages and suicides so its not just the same one all the time and added a kill streak to the end. I created the Battle for Cherno PVP server and you will see most of the scripts in action there. Don't want to hide info so just PM me if you need anything and ill make sure i look at this website once a day! Edited October 22, 2018 by MrSisterFister Shitty spelling and better read Share this post Link to post Share on other sites