[TUT - 508] 100% Full trading

Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 41
  1. #16
    I am THE DON Joe9099 is offline
    MemberRank
    Jan 2007 Join Date
    England, UkLocation
    3,655Posts

    Re: [TUT - 508] 100% Full trading

    Quote Originally Posted by ThuGie View Post
    Uhm i liked the title so i took a quick look and noticed this small thing,
    Code:
            Player p2 = Engine.players[p.clickId];
            if (p2.pTrade.getPartner() == p) {
            } else {
                p.frames.sendMessage(p, "Sending trade request...");
                p.frames.sendMessage(p2, p.username.substring(0, 1).toUpperCase() + p.username.substring(1) + ":tradereq:");
            }
            p.requestFaceTo(p.clickId);
            p.pTrade.tradePlayer(p2);
            p.playerOption2 = false;
    Its really small but shouldnt it be more like this ?

    Code:
            Player p2 = Engine.players[p.clickId];
            if (p2.pTrade.getPartner() != p) {
                p.frames.sendMessage(p, "Sending trade request...");
                p.frames.sendMessage(p2, p.username.substring(0, 1).toUpperCase() + p.username.substring(1) + ":tradereq:");
            }
            p.requestFaceTo(p.clickId);
            p.pTrade.tradePlayer(p2);
            p.playerOption2 = false;
    Not 100% sure as i havent coded in java for ages :p.
    It would not matter, even though i havnt tested, by the looks of it, why would it make any difference what so ever lol?

  2. #17
    ThuGie.NL - Webmaster ThuGie is offline
    MemberRank
    Apr 2006 Join Date
    NetherlandsLocation
    1,131Posts

    Re: [TUT - 508] 100% Full trading

    As i said its something small,
    And because the one thats currently posted looks like its wroten by a brainless idiot..
    Why create a else when you not gone use it :S.

  3. #18
    Proficient Member stability666 is offline
    MemberRank
    Jan 2009 Join Date
    Maine, USA.Location
    165Posts

    Re: [TUT - 508] 100% Full trading

    Quote Originally Posted by ThuGie View Post
    As i said its something small,
    And because the one thats currently posted looks like its wroten by a brainless idiot..
    Why create a else when you not gone use it :S.
    What a most brainless arguement this is. Its set like that because (p2.pTrade.getPartner() == p) { is telling the server whether the person has a trading partner or not. Joe is right it wouldn't make any difference.
    Although there could be something, very very small there.
    Although I may be wrong as I am a simpleton XD

    ~Stability666

  4. #19
    Enthusiast sillygoose is offline
    MemberRank
    Sep 2006 Join Date
    33Posts

    Re: [TUT - 508] 100% Full trading

    i just got 1 error =/

    Code:
    .\palidino76\rs2\players\ptrade\PTrade.java:125: cannot find symbol
    symbol  : method haveItem(palidino76.rs2.players.Player,int,int)
    location: class palidino76.rs2.players.items.PlayerItems
            if (!pi.haveItem(p, itemId, itemAmt)) {
                   ^
    1 error

  5. #20
    I am THE DON Joe9099 is offline
    MemberRank
    Jan 2007 Join Date
    England, UkLocation
    3,655Posts

    Re: [TUT - 508] 100% Full trading

    Hey, try adding this in PlayerItems.java

    Code:
    	public boolean haveItem(Player p, int itemID, int amount) {
    	    //itemID++;
    	    int found = 0;
            for (int i = 0; i < p.items.length; i++) {
                if (p.items[i] == itemID) {
    		    if(p.itemsN[i] >= amount)
    				return true;
    		    else
    			    found++;
                }
            }
    	if(found >= amount)
    		return true;
            return false;
        }

  6. #21
    Apprentice grundyboy34 is offline
    MemberRank
    Aug 2009 Join Date
    6Posts

    Re: [TUT - 508] 100% Full trading

    my compiler shows these errors please help!!

    .\Bulby\.\io\Frames.java:859: class, interface, or enum expected
    public void setAccessMask(Player p, int set, int window, int inter, int off,
    int len) {
    ^
    .\Bulby\.\io\Frames.java:862: class, interface, or enum expected
    }
    ^
    .\Bulby\.\io\Frames.java:864: class, interface, or enum expected
    p.stream.writeWord(len);
    ^
    .\Bulby\.\io\Frames.java:865: class, interface, or enum expected
    p.stream.writeWordBigEndianA(off);
    ^
    .\Bulby\.\io\Frames.java:866: class, interface, or enum expected
    p.stream.writeWordBigEndian(window);
    ^
    .\Bulby\.\io\Frames.java:867: class, interface, or enum expected
    p.stream.writeWordBigEndian(inter);
    ^
    .\Bulby\.\io\Frames.java:868: class, interface, or enum expected
    p.stream.writeWordBigEndian(set);
    ^
    .\Bulby\.\io\Frames.java:869: class, interface, or enum expected
    p.stream.writeWordBigEndian(0);
    ^
    .\Bulby\.\io\Frames.java:870: class, interface, or enum expected
    }
    ^
    .\Bulby\.\io\Frames.java:879: class, interface, or enum expected
    public void runScript(Player p, int id, Object[] o, String valstring) {
    ^
    .\Bulby\.\io\Frames.java:882: class, interface, or enum expected
    }
    ^
    .\Bulby\.\io\Frames.java:884: class, interface, or enum expected
    p.stream.writeString(valstring);
    ^
    .\Bulby\.\io\Frames.java:885: class, interface, or enum expected
    int j = 0;
    ^
    .\Bulby\.\io\Frames.java:886: class, interface, or enum expected
    for (int i = (valstring.length() - 1); i >= 0; i--) {
    ^
    .\Bulby\.\io\Frames.java:886: class, interface, or enum expected
    for (int i = (valstring.length() - 1); i >= 0; i--) {
    ^
    .\Bulby\.\io\Frames.java:886: class, interface, or enum expected
    for (int i = (valstring.length() - 1); i >= 0; i--) {
    ^
    .\Bulby\.\io\Frames.java:889: class, interface, or enum expected
    } else {
    ^
    .\Bulby\.\io\Frames.java:891: class, interface, or enum expected
    }
    ^
    .\Bulby\.\io\Frames.java:893: class, interface, or enum expected
    }
    ^
    .\Bulby\.\io\Frames.java:895: class, interface, or enum expected
    p.stream.endFrameVarSize();
    ^
    .\Bulby\.\io\Frames.java:896: class, interface, or enum expected
    }
    ^
    21 errors
    Press any key to continue
    help please
    Last edited by grundyboy34; 20-08-09 at 06:39 AM.

  7. #22
    right + down + X GhostSnyper is offline
    MemberRank
    May 2006 Join Date
    AZ, USALocation
    2,818Posts

    Re: [TUT - 508] 100% Full trading

    @ drundy, you have an extra } in your code.somewhere before like 859 of that class, there will be an extra } that doesn't need to be there... Probably because you pasted wrong(you failure!)...

  8. #23
    Apprentice grundyboy34 is offline
    MemberRank
    Aug 2009 Join Date
    6Posts

    Re: [TUT - 508] 100% Full trading

    Ok see if you see the problem it should be in this general area!
    PHP Code:
        /**
         * Send the map region and other positioning info to the client.
         * @param p The Player which the frame should be created for.
         */
        
    public void setMapRegion(Player p) {
            if (
    == null || p.stream == null || p.disconnected[0]) {
                return;
            }
            
    p.stream.createFrameVarSizeWord(142);
            
    p.stream.writeWordA(p.mapRegionX);
            
    p.stream.writeWordBigEndianA(p.currentY);
            
    p.stream.writeWordA(p.currentX);
            
    boolean forceSend true;
            
    p.rebuildNPCList true;

            if ((((
    p.mapRegionX 8) == 48) || ((p.mapRegionX 8) == 49))
                    && ((
    p.mapRegionY 8) == 48)) {
                
    forceSend false;
            }
            if (((
    p.mapRegionX 8) == 48) && ((p.mapRegionY 8) == 148)) {
                
    forceSend false;
            }
            for (
    int xCalc = (p.mapRegionX 6) / 8xCalc
                    
    <= ((p.mapRegionX 6) / 8); xCalc++) {
                for (
    int yCalc = (p.mapRegionY 6) / 8yCalc
                        
    <= ((p.mapRegionY 6) / 8); yCalc++) {
                    
    int region yCalc + (xCalc << 1786653352);

                    if (
    forceSend
                            
    || ((yCalc != 49) && (yCalc != 149) && (yCalc != 147)
                            && (
    xCalc != 50) && ((xCalc != 49) || (yCalc != 47)))) {
                        
    int[] mapData Engine.mapData.getData(region);

                        
    p.stream.writeDWord(mapData[0]);
                        
    p.stream.writeDWord(mapData[1]);
                        
    p.stream.writeDWord(mapData[2]);
                        
    p.stream.writeDWord(mapData[3]);
                    }
                }
            }
            
    p.stream.writeByteC(p.heightLevel);
            
    p.stream.writeWord(p.mapRegionY);
            
    p.stream.endFrameVarSizeWord();
        }
    }
    /**
         * Sets item options allowed
         * @param p The Player which the frame should be created for.
         * @param set The access mask
         * @param window The window or child interface id
         * @param inter The main interface id
         * @param off The item offset to start with
         * @param len The item count to set
         */
        
    public void setAccessMask(Player pint setint windowint interint offint len) {
            if (
    == null || p.stream == null || p.disconnected[0]) {
                return;
            }
            
    p.stream.createFrame(223);
            
    p.stream.writeWord(len);
            
    p.stream.writeWordBigEndianA(off);
            
    p.stream.writeWordBigEndian(window);
            
    p.stream.writeWordBigEndian(inter);
            
    p.stream.writeWordBigEndian(set);
            
    p.stream.writeWordBigEndian(0);
        }

        
    /**
         * Runs an ClientScript2 script
         * @param p The Player which the frame should be created for.
         * @param id The script id
         * @param o The script arguments
         * @param valstring The argument types
         */
        
    public void runScript(Player pint idObject[] oString valstring) {
            if (
    valstring.length() != o.length) {
                throw new 
    IllegalArgumentException("Argument array size mismatch");
            }
            
    p.stream.createFrameVarSizeWord(152);
            
    p.stream.writeString(valstring);
            
    int j 0;
            for (
    int i = (valstring.length() - 1); >= 0i--) {
                if (
    valstring.charAt(i) == 115) {
                    
    p.stream.writeString((String) o[j]);
                } else {
                    
    p.stream.writeDWord((Integer) o[j]);
                }
                
    j++;
            }
            
    p.stream.writeDWord(id);
            
    p.stream.endFrameVarSize();
        } 
    [mod]Please use [/php] tags instead of quote or code tags. Color codes and spaces properly. Thanks
    Regards,
    ~GhostSnyper[/mod]
    Last edited by GhostSnyper; 20-08-09 at 07:50 AM.

  9. #24
    right + down + X GhostSnyper is offline
    MemberRank
    May 2006 Join Date
    AZ, USALocation
    2,818Posts

    Re: [TUT - 508] 100% Full trading

    lawl sec

    Edit: You have an extra } after your setMapReigon method

    Especially with your proper spacing, that should've been really easy to spot
    Last edited by GhostSnyper; 20-08-09 at 07:54 AM.

  10. #25
    Apprentice grundyboy34 is offline
    MemberRank
    Aug 2009 Join Date
    6Posts

    Re: [TUT - 508] 100% Full trading

    sorry to tell you this but i'm completely new to java but i am learning some of it.
    anyway can you please post my problem and post what i need to replace it with.

    or just highlight what i need to remove

    when i take off one } it will say reached end of file while parsing
    please help
    Last edited by grundyboy34; 20-08-09 at 08:09 AM. Reason: update

  11. #26
    Apprentice grundyboy34 is offline
    MemberRank
    Aug 2009 Join Date
    6Posts

    Re: [TUT - 508] 100% Full trading

    help i still cant figure this out


    also if you can help with my ranging system i would be grateful because when you try to range most npc's your client crashes which means it is probably client sided

    and i also need to add dclaws spec for player against player
    it will come up errors when added!

    and i need help adding d2h spec for all

  12. #27
    Enthusiast Dj WhizzKid is offline
    MemberRank
    May 2008 Join Date
    36Posts

    Re: [TUT - 508] 100% Full trading

    Thanks dude, it completely works. I had to do a few edits to get it to my servers defaults, and my servers nearly like a runescape server type, I also hate the easy skill ones. They do suck lol.

    Just can't find the runescape tutorial island coordinates, anyone have a clue what they are?

    On-Topic:
    EDIT: Thanks :) - I had 94 errors first, just did abit of tweaking, fixed!

    - WhizzKid
    Last edited by Dj WhizzKid; 21-08-09 at 01:18 PM. Reason: fixed :)

  13. #28
    Venture Adventure Tyler is offline
    LegendRank
    Nov 2008 Join Date
    United KingdomLocation
    4,443Posts

    Re: [TUT - 508] 100% Full trading

    Grundy, please post a proper thread with your issues.

  14. #29
    Proficient Member stability666 is offline
    MemberRank
    Jan 2009 Join Date
    Maine, USA.Location
    165Posts

    Re: [TUT - 508] 100% Full trading

    Quote Originally Posted by grundyboy34 View Post
    help i still cant figure this out


    also if you can help with my ranging system i would be grateful because when you try to range most npc's your client crashes which means it is probably client sided

    and i also need to add dclaws spec for player against player
    it will come up errors when added!

    and i need help adding d2h spec for all
    LOL? You can't add custom items to 508's. And 508's don't have Dragon Claws. Also, this tutorial is made for 508.

  15. #30
    Novice Greg11011 is offline
    MemberRank
    Oct 2009 Join Date
    3Posts

    Re: [TUT - 508] 100% Full trading

    I only got one error when i did all this and that was ptrade.java could not be accessed and all the imports were correct and even the caps of the name itself were correct so idk whats wrong with it.



Page 2 of 3 FirstFirst 123 LastLast

Advertisement