Home   Help Search Login Register  

Author Topic: SERVER cleanup issues  (Read 1311 times)

0 Members and 1 Guest are viewing this topic.

Offline D007

  • Members
  • *
SERVER cleanup issues
« on: 17 Sep 2008, 05:35:17 »
Heya Spon..
You ever try to incorperate a clean up script into the spon script.. like dynbr?
I keep trying to find a way to get the vehicles bought by spon money to delete after they have been destroyed..
think you might be able to help me out with this one?
I'd really appreciate it  thanks a bunch..

the line Myke said to use is..
Code: [Select]
nul = [this] execVM "DynBr\DynBr_addEH.sqf"
Says to put it right after the creation of the vehicle.
but I put it after the creation of the vehicle in spon show shop dialog and it just doesn't seem to work.
Thanks a bunch.

EDIT:
Anyone know a good server cleanup script?
Not many things work on the server..
i doubt this will work.. nothing else i have tried has..
« Last Edit: 17 Sep 2008, 19:42:23 by D007 »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Spon money and SERVER cleanup issues
« Reply #1 on: 17 Sep 2008, 13:58:27 »
Yes, this won't work, since you are only adding the cleanup on the player's local machine (any script run from a dialog is local to the client machine). When a vehicle has players in it, then it will be local to the effectiveCommander's machine, but once a vehicle is empty, it moves onto the server, so the script will never be able to delete it.

What you want is to replace "_itemClass createVehicle (getPos player);" with:
Code: (showShopDialog.sqf patch (untested)) [Select]
private "_vehicle";
_vehicle = _itemClass createVehicle (getPos player);
player reveal _vehicle; // Something else missing, which gives you access to the vehicle right away.
_vehicle setVehicleInit "if (isServer) then { [this] execVM 'DynBr\DynBr_addEH.sqf' };";
processInitCommands;

Loki (and others) have been at me to go back and "fix" SPON Money for a long, long time, asking for stuff like allowing the mission-maker to add custom code that is run when you buy and sell stuff, without having to edit the scripts directly (if you need to do that, then the script is broken ;P). I do intend to return to it, but it is really bottom of my list compared to stuff like SPON Map (and others). Sorry!
« Last Edit: 17 Sep 2008, 14:00:24 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline D007

  • Members
  • *
Re: Spon money and SERVER cleanup issues
« Reply #2 on: 17 Sep 2008, 18:57:13 »
all good.. believe me I am eternally greatful for this..lol..
Been trying all night to get these things to delete..

So would _unit be used instead of _itemclass for unitcreation then?
like:
Code: [Select]
if (_itemclass iskindof "SoldierGCaptive")then{_unit  = private "_unit";_unit = _itemClass createunit [position player, group player,_unit setVehicleInit "if (isServer) then { [this] execVM 'DynBr\DynBr_addEH.sqf' },",processInitCommands,",0.5,"PRIVATE"];};
?
I tried a simple not alive player hidebody player trigger.
but i need to teleport the bodies out of the zombies spawn zone or the zombie script causes an error.. idk why..
so i warp them then put them into a CS. the body is supposed to hide then..

but it seems like once the hidebody command is given it hides everyone who dies after the first player instantly goes intot he hidebody animation.

then they warp and are stuck above ground..
does the hidebody even delete them anyway?
 i figured if they were above ground they would be deleted eventually anyway but there they are .. XD


I'm sure that will fix the deletion of vehicles at least, so 1 out of 2 ain't bad. :)

Thanks a bunch.
« Last Edit: 17 Sep 2008, 20:11:49 by D007 »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Spon money and SERVER cleanup issues
« Reply #3 on: 17 Sep 2008, 19:32:08 »
Well since DMurphyMan added the purchase of soldiers to SPON Money, I can hardly be the one to explain how to modify his modifications ;P There are several major syntax errors in that line of code alone (you need to learn the correct syntax and understand the usage of both private and createunit).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline D007

  • Members
  • *
Re: Spon money and SERVER cleanup issues
« Reply #4 on: 17 Sep 2008, 19:39:02 »
I agree..lol..
I'll hack into it until i figure it out.

I caught most of the syntax errors I think and edited that.. I'm just brain fried..
up all night doing this again.

Though I can create unit np..lol..
I'm just totally unfamiliar with this private command and a lot of server related things.

If anyone would like to just help with this problem I'm having, feel free though..

we all have to start somewhere..
« Last Edit: 17 Sep 2008, 20:12:08 by D007 »