Thread: Does my code is right?

Results 1 to 8 of 8
  1. #1 Does my code is right? 
    Registered Member Hexagon's Avatar
    Join Date
    May 2008
    Posts
    672
    Thanks given
    28
    Thanks received
    18
    Rep Power
    33
    Since i'm not at home and i can't compile (not admin 2 download jdk) i wnna ask you guys if this code is right:

    Code:
    if(rune1 == 555 || rune2 == 555  || rune3 == 555 || rune4 == 555 && playerEquipment[playerWeapon] = 1383) {
    playerHasItem(555);
    }
    AND this one
    Code:
    if(!playerHasItem(555) && playerEquipment[playerWeapon] = 1383) {
    playerHasItem(555);
    }
    is anything wrong with it? witch one is better
    delta source (no flame)
    Reply With Quote  
     

  2. #2  
    Austin_
    Guest
    What are you trying to make the code do?
    Reply With Quote  
     

  3. #3  
    Registered Member Hexagon's Avatar
    Join Date
    May 2008
    Posts
    672
    Thanks given
    28
    Thanks received
    18
    Rep Power
    33
    making elemental staff works... if the rune1 is 555(water rune) and the staff is 1383(water staff) it returns than the player HAVE water runes

    EDIT improved it abit
    Reply With Quote  
     

  4. #4  
    Austin_
    Guest
    Wouldn't that just make it so it only shows that the player has a water rune? If that's what your aiming for, yes.
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Oct 2007
    Posts
    596
    Thanks given
    103
    Thanks received
    29
    Rep Power
    77
    ok, i have never tried anything like this before?

    Code:
    if(playerEquipment[playerWeapon] = 1383) {
    playerHasItem(555);
    }
    that would say, if hes wielding staff then he has item 555?? (water runes)



    (i have never tried to write anything myself before )

    Reply With Quote  
     

  6. #6  
    Registered Member Hexagon's Avatar
    Join Date
    May 2008
    Posts
    672
    Thanks given
    28
    Thanks received
    18
    Rep Power
    33
    Quote Originally Posted by uchiha owner View Post
    ok, i have never tried anything like this before?

    Code:
    if(playerEquipment[playerWeapon] = 1383) {
    playerHasItem(555);
    }
    but wouldn't just that work?



    (i have never tried to write anything myself before )
    I think than works too but since i can't test... =\

    i think all ways work since it will check WHEN the players try 2 cast the spell
    Reply With Quote  
     

  7. #7  
    Austin_
    Guest
    Tell me where to add the code and ill test on my Delta base.
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Dec 2007
    Age
    32
    Posts
    551
    Thanks given
    0
    Thanks received
    2
    Rep Power
    503
    Code:
    private int staffType(Client client) {
    		switch (client.playerEquipment[3]) {
    			case 1381:
    				return 556;
    		}
    		return 0;
    	}
    Then check,

    Code:
    if (staffType(this) == rune1) {
        //stuffhere;
    }
    I have Client their cuz i do my stuff in seperate classes so work it out. I put this, because i know from this you just throw shit in your client class file...
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •