Author Topic: How do you make key-binds?  (Read 777 times)

I am really getting into animating my upcoming vehicles, but I want to set the animation trigger to, say, the V-Key, instead of having to use space-bar. (allowing people to use thier vehicle brakes without opening doors, retracting roofs, etc.) But I want to allow this key bind to be changed by the player to suit their preferences in the Controls Options. How would I go about doing this?

Code: [Select]
if (!$<ModNameHere>Binds)
{
$remapDivision[$remapCount] = "This is the section name in the controls options";
$remapName[$remapCount] = "This is the command's name in the controls options";
$remapCmd[$remapCount] = "This is the function it sends";
$remapCount++;
$<ModNameHere>Binds = 1;
}

Will that help?

Keybinds require a client-side mod. If you want this to be usable by everyone on your server, package and use one of the existing keys instead, such as the Light or Paint Can buttons when not in use.

alright im not sure i understand it all, but lets just scrap the whole letting the player choose what key to bind it to.

how can i just make it so its activated by the vkey? or does it have to be a key that is already used by something? what would you suggest the vehicle animation be triggered by?

Generally has to be something already bound. Some examples, jets trigger (although for vehicles that takes you out of it), jump, light, paint, use tools, fire weapons (Tank shell-type)

i figured as much.
what would you suggest i use? should i just stick to the space-bar?

Space Bar is good, but if you are in a land vehicle, it will put on the brakes.  I would do either clicking or spacebar, personally.