Blockland Forums > Suggestions & Requests
Physics Vehicles:Can they be optimized? +More
<< < (5/5)
Blocki:

--- Quote from: MARBLE MAN on December 04, 2012, 01:21:03 AM ---Highly advised you don't use this
function servercmdjeep(%cl)
{
%position = %cl.player.getPosition();
   %posX = getword(%position, 0);
   %posY = getword(%position, 1);
   %posZ = getword(%position, 2) + 10;
   %rot = getWords(%position, 3, 8);
%newcar = new WheeledVehicle()
   {
   
      dataBlock = Jeepvehicle;
      client = %cl;
      initialPosition = %posX @ " " @ %posY @ " " @ %posZ;
   };
   MissionCleanup.add(%newcar);
%newcar.setTransform(%posX @ " " @ %posY @ " " @ %posZ @ " " @ %rot

tested and working
although, you can not clear them with /clearvehicles, this will spawn you a jeep when you type /jeep
this will FORCE a jeep to be spawned.
Also, if too many jeeps are spawned, you guessed it, you lag alot
don't have too much fun);
}



--- End quote ---
I had 12 fps with 400 jeeps and max shaders
Also, do this:

--- Code: ---new SimGroup(UselessJeeps){};




UselessJeeps.add(%newvehicle);

--- End code ---
I can't remember whether you need the {}, sorry

Edit: Your code is horrible btw
MARBLE MAN:

--- Quote from: Blocki on December 05, 2012, 01:09:15 PM ---Your code is horrible btw

--- End quote ---
it works though
and what part of it is horrible?
Wheatley:

--- Quote from: MARBLE MAN on December 05, 2012, 10:54:27 PM ---what part of it is horrible?

--- End quote ---
why are you getting the XYZ vectors separately if you're using them all together anyway?
what's with all the %var @ " " @ %tar
and it's generally just badly written
Navigation
Message Index
Previous page

Go to full version