Thread: Mouse Control
View Single Post
  #7  
Old 04-13-2006, 09:28 PM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally Posted by excaliber7388
as well as the weapon switching, I don't know how to set a player's weapon
Hello again ive combined a few things for you to look at

NPC Code:

if (keypressed) {
if (keydown2(keycode(r),true)) {
for (i=0;i<weaponscount;i++) {
if (strequals(#w(i),Bomb)) {
selectedweapon = i;
}
}
}
}



Basically its just going through Indexes of the weapons until it finds bomb, then setting "Selectedweapon" to Bomb.

You could use it probably for a whole inventory system by just setting a string like "Equipped Weapon" and replacing bomb with your string to always set it.

Good Luck.
Reply With Quote