Author Topic: How can I change what space does when on a vehicle?  (Read 2373 times)

So I have a vehicle and I want to do something special when you press space (Or another button, as long as it's server-side (Ex. clients don't need to type in a long console command)). Is this possible, and if it is how can I do it?

I don't think its posible, you would need a client side keybinding.

Not really, on the Horse space jumps, on the jeep space stops.
:)

Badspot

  • Administrator
Something like this:
Code: [Select]
function MyLeetVehicleData::OnTrigger(%this, %obj, %triggerNum, %val)
{
   if(%val) //1 = trigger down, 0 = trigger up
      if(%triggerNum == 2) //2 = jump trigger
         //do stuff...
}

Jump, shoot, crouch, and jet all use triggers and will fire this callback when activated.  You might have to do vehicle::ontrigger or wheeledvehicle::ontrigger instead.  Experiment.


yeah, it was my idea. (its for his hover board)

Thanks a bunch! :D

(@Jay Ray: It isn't my Hover Board, it's Cap's)

oh, well the /ollie being linked to the space bar was my idea i think.