Quote:
Originally Posted by Crow
Should actually look like this:
PHP Code:
//#CLIENTSIDE
function onKeyPressed(code, key) {
if (key == "d") {
findWeapon(player.weapon.name).trigger("WeaponFired", nil);
}
}
Well, some things are preference, but trigger("Event", nil) triggers "onEvent", not "Event", and I had some problem triggering weapons when not using findWeapon() before, might have been me back then though.
|
Fair enough, I just posted a rough example. I haven't used trigger() for a while.
Also, you don't need findWeapon, you can just do ( @ player.weapon.name ).trigger( ... ); last I checked.