because I don't think this has been requested/made.Whereas, the player leaves the server, all of his/her vehicles are cleared.I would need this for things and other would too.
Why not an option for bricks aswell?
package clearToys{ function GameConnection::onClientLeaveGame(%client) { for(%i=0; %i < %client.brickGroup.getCount(); %i++) { %brick = %client.brickGroup.getObject(%i); if(%brick.getDatablock().getName() $= "brickVehicleSpawnData" || %brick.getDatablock().getName() $= "SmallVehicleSpawnData" || %brick.getDatablock().getName() $= "SuperSmallVSData") { %brick.killBrick(); } } Parent::onClientLeaveGame(%client); }};activatePackage(clearToys);
I'm pretty sure I did everything right, but I am not in a position to test it.Someone do it for me, please.Script_RemoveVehicles
Works quite well, will it be released as an add-on?
I have an additional suggestion, if the player leaves with vehicles, server not only removes them, but records them, thus', when the player rejoins, his vehicles are placed back automacly, without removing the brick at all.
Here you go.Code: [Select]package clearToys{ function GameConnection::onClientLeaveGame(%client) { for(%i=0; %i < %client.brickGroup.getCount(); %i++) { %brick = %client.brickGroup.getObject(%i); if(%brick.getDatablock().getName() $= "brickVehicleSpawnData" || %brick.getDatablock().getName() $= "SmallVehicleSpawnData" || %brick.getDatablock().getName() $= "SuperSmallVSData") { %brick.killBrick(); } } Parent::onClientLeaveGame(%client); }};activatePackage(clearToys);