Well let's throw some more detail your way...
player.weapons - holds a list of weapon objects that you currently have:
PHP Code:
for (temp.weapon: player.weapons) {
echo(temp.weapon.name);
}
You can check if a player has a certain weapon like this:
PHP Code:
// Setup: Weapon name to check for
temp.weaponname = "-System";
// Method using findweapon
temp.weapon = findweapon(temp.weaponname);
if (temp.weapon in player.weapons) {
echo("Player has " @ temp.weaponname);
}
// Directly referring to the weapon object
if ((@temp.weaponname) in player.weapons) {
echo("Player has " @ temp.weaponname);
}
You can even access functions and variables in other weapons:
PHP Code:
findweapon("-System").someAwesomeFunction();
echo((@"-System").answer)); // echos "3"
Weapon: -System
PHP Code:
public function someAwesomeFunction() {
echo("awesomeness detected.");
}
this.answer = "3";
The methods are basically the same, except the findweapon way is little more clear (imo) to other people reading the script.