View Single Post
  #9  
Old 07-25-2010, 09:38 AM
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 oo_jazz_oo View Post
player.selectedweapon is the index of the selected weapon in the players weapon aray.

PHP Code:
if (player.selectedweapon == player.weapons.index(findweapon("Name"))) 
Should be:

PHP Code:
if (player.weapon == this) { // weapon is currently selected 
For selecting a weapon:
PHP Code:
player.selectedWeapon player.weapons[player.weapons.index(findWeapon("Weapon"))].id// select a weapon by name 
Not sure if there is a better way to do the second, but yours probably won't work since player.weapons is an array of weapon objects.
__________________
Reply With Quote