Author Topic: getting a map to load bricks + getclass  (Read 1163 times)

package raceway
{
   function GameConnection::OnClientEnterGame(%this)
   {
      Parent::OnClientEnterGame(%this);
      serverDirectSaveFileLoad("Add-Ons/Map_BushiPandan_Raceway/Starting_Gate.bls", 3, "", 0, 1);
      centerPrint(%this, "Loading Map Bricks", 5);
   }
};



Im not a scripter.

Im just trying to find a way to get my save file to load automatically.
« Last Edit: August 27, 2009, 11:53:27 AM by MtnDew »

Why is it that people use OnClientEnterGame?
Just stick serverDirectSaveFileLoad("Add-Ons/Map_BushiPandan_Raceway/Starting_Gate.bls", 3, "", 0, 1);
at the end of the .mis file.

Why is it that people use OnClientEnterGame?
Just stick serverDirectSaveFileLoad("Add-Ons/Map_BushiPandan_Raceway/Starting_Gate.bls", 3, "", 0, 1);
at the end of the .mis file.
oh.

Thanks alot :D

It says $Loadingbricks_brickgroup does not exist!


Also,

function DeathTrigger::onEnterTrigger( %this, %trigger, %player )
{
   echo( "Inside of Track Trigger");
   
   centerPrint(%player, "You cannot be on the track without a vehicle", 10);
   // This method is called whenever an object enters the %trigger
   // area, the object is passed as %obj.  The default onEnterTrigger
   // method (in the C++ code) invokes the ::onTrigger(%trigger,1) method on
   // every object (whatever it's type) in the same group as the trigger.
   %player.kill();
   Parent::onEnterTrigger( %this, %trigger, %player );
   
}


That kills players and vehicles.
How do i make a getlclass to only damage players?
« Last Edit: August 27, 2009, 11:54:02 AM by MtnDew »

function DeathTrigger::onEnterTrigger( %this, %trigger, %player )
{
   if(%player.getClassName() $= "Player")
   {
      centerPrint(%player.client, "You cannot be on the track without a vehicle", 10);
      %player.kill();
   }
   Parent::onEnterTrigger( %this, %trigger, %player );
}

function DeathTrigger::onEnterTrigger( %this, %trigger, %player )
{
   if(%player.getClassName() $= "Player")
   {
      centerPrint(%player.client, "You cannot be on the track without a vehicle", 10);
      %player.kill();
   }
   Parent::onEnterTrigger( %this, %trigger, %player );
}

<3

I still need help with the brick loading. D:


It says $Loadingbricks_brickgroup does not exist!


« Last Edit: August 27, 2009, 12:04:03 PM by MtnDew »

Use (%player.getType() & $TypeMasks::PlayerObjectType) instead. That way it works if you do something like put a bot in a car then destroy the vehicle so it's on the track.

Try adding a schedule to it?

Use (%player.getType() & $TypeMasks::PlayerObjectType) instead. That way it works if you do something like put a bot in a car then destroy the vehicle so it's on the track.
They way i did it works the same?
It has a 100ms tick.

So, i can get in the car... (before entering the zone) Drive into the zone.. Then get out.. And die.
+ Im not using bots on this map D:

:D
Also, i changed the centerprint to bottomprint.
That way it doesn't conflict with the "Respawning in..."

Try adding a schedule to it?
?

Im a noob scripter D:

EDIT:

Oh, found chrono's old post.
schedule(1000,0,serverDirectSaveFileLoad,"Add-Ons/Map_TEST/utbrks.bls", 3, "", 0, 1);
« Last Edit: August 27, 2009, 12:30:56 PM by MtnDew »

They way i did it works the same?
It has a 100ms tick.

So, i can get in the car... (before entering the zone) Drive into the zone.. Then get out.. And die.
+ Im not using bots on this map D:
Yes. Chrono's method works with normal players, my method works with normal players and AIPlayers. You don't currently use bots but it might help if you manage to make AI drivers or something.