View Single Post
  #8  
Old 05-03-2008, 05:05 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Crow View Post
Should actually look like this:

PHP Code:
//#CLIENTSIDE
function onKeyPressed(codekey) {
  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.
__________________
Reply With Quote