View Single Post
  #17  
Old 06-25-2011, 09:46 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by ffcmike View Post
player.weapons is an array of objects rather than strings.

If you were to do:

PHP Code:
for(temp.w : player.weapons){
  echo(
temp.w.name);
} 
You would see the names of each weapon object.

I wouldn't recommend using that method though, it would take up more script time unnecessarily.
Well I was going to use it to check if a player no longer has a skill (and therefore delete the weapon). Is there a better method you would suggest?

I was going to do something like loop:
PHP Code:
function onCheckSkills(){
  for(
i=0;i<weapon array.size();i++){
    if(!(
weapon array[i] in client.skills){
      
removeWeapon(weapon array[i]);
    }
  }
} 
(where "weapon array" is the variable holding the weapon array)
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote