Page 1 of 1

bind keys

Posted: Tue Jun 29, 2004 4:47 pm
by lizardkid
how can i call a bind from the script?

i want to check for my new bind to be pressed, when it is, more code... bla bla bla, anyway, how can i check or wait for a bind?

bind

Posted: Tue Jun 29, 2004 5:33 pm
by tltrude
I take it you are asking about binding control keys. Well, it depends on what you are tring to do. Clients don't like it when their control keys are changed by the script! So, it is better to just have them press the "use" key or the "fire" (left mouse) button to activate your thread.

What is it for?

Posted: Tue Jun 29, 2004 5:59 pm
by lizardkid
well i'm making an SP/MP mod for the player to be able to drop exploding bangalores whenever they want. i think i have most of th other code figured out but i just don't know how to deal with control keys. how to detect them being pressed.

i know, i don't much care to have my keys changed either, but the user of the mod would choose which key it was that he drops bangalores with.

weapon

Posted: Tue Jun 29, 2004 6:25 pm
by tltrude
Ok, what you are talking about doing is adding a new weapon or item to the players inventory. In singleplayer they are handled by the global/items.script and the global/loadout.scr. But, the bangalor is already in the items.scr script.

For multiplayer, the weapons are limited, and new global scripts would be required, I think.

Posted: Wed Jun 30, 2004 5:47 pm
by lizardkid
well what i'm after is how to find out if a key is presed. i'll want a new bind for this personally since you can't hold a bangalore without making a new weapon and all that, which i'm not interested in. i just want the playe to be able to plant bangalores at will. i have everything else set up. (it'll need debugging of course) but all i need is how to detect a key press.

key press

Posted: Wed Jun 30, 2004 9:19 pm
by tltrude
while (local.player.useheld)

or

while (local.player.fireheld)