Thread: Loading Objects!?

Results 1 to 9 of 9
  1. #1 Loading Objects!? 
    Ash
    Guest
    Im stuck on this.
    Because i cannot get it right. The objects will not load at all,

    Heres the method for the NewObjects.
    Code:
    public void makeGlobalObject(int x, int y, int typeID, int orientation,
    			int tileObjectType) { // Makes Global objects
    		for (Player p : PlayerHandler.players) {
    			if (p != null) {
    				client person = (client) p;
    				if ((person.playerName != null || person.playerName != "null")) {
    					if (person.distanceToPoint(x, y) <= 60) {
    						person.createNewTileObject(x, y, typeID, orientation,
    								tileObjectType);
    					}
    				}
    			}
    		}
    	}
    Heres the object i wont to load.
    Code:
    public void NewObjects() {
    		makeGlobalObject(2616, 3104, 5162, 0, 10);
    
    	}
    I also added this into Case 210:
    Code:
    case 210:
    			NewObjects();
    			break;
    It just will not load the objects in the server.

    Please help

    If you help i will Rep++
    Reply With Quote  
     

  2. #2  
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,147
    Thanks given
    2,656
    Thanks received
    3,731
    Rep Power
    5000
    change

    Code:
    				if ((person.playerName != null || person.playerName != "null")) {
    to

    Code:
    				if ((person.playerName != null)) {
    The player name isn't going to be set to the string "null" anyone, plus != like that will not work (as there will be two instances of the string). You have to use the equals() method.
    .
    Reply With Quote  
     

  3. #3  
    Ash
    Guest
    Still doesent work Graham.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Oct 2009
    Posts
    182
    Thanks given
    0
    Thanks received
    0
    Rep Power
    223
    Call the NewObjects() method under packet 121.
    My alias is The Soul.
    Reply With Quote  
     

  5. #5  
    Ash
    Guest
    Thanks Soul

    Rep'd.
    Reply With Quote  
     

  6. #6  
    Member Loading Objects!? Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    client person = (client) p;
    ???

    Why not just use p.whatever ?

    Attached imageAttached image
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    Jul 2008
    Age
    28
    Posts
    5,827
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    Quote Originally Posted by Caronok View Post
    Call the NewObjects() method under packet 121.
    That is NOT correct. His problem is elsewhere, or his client is screwed.
    Reply With Quote  
     

  8. #8  
    Loading Objects!?



    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    30
    Posts
    16,307
    Thanks given
    7,215
    Thanks received
    12,308
    Rep Power
    5000
    Code:
    public void makeGlobalObject(int x, int y, int typeID, int orientation,
    			int tileObjectType) { // Makes Global objects
    		for (Player p : PlayerHandler.players) {
    			if (p.distanceToPoint(x, y) <= 60) {
    				p.createNewTileObject(x, y, typeID, orientation,
    						tileObjectType);
    			}
    		}
    	}

    That might help?

    Attached image
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    Jul 2008
    Age
    28
    Posts
    5,827
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    Quote Originally Posted by Luke132 View Post
    ???

    Why not just use p.whatever ?
    Because the methods aren't in the Player class, genious.
    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
  •