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
i just got 1 error =/
1 errorCode:.\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)) { ^
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; }
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 continuehelp please
Last edited by grundyboy34; 20-08-09 at 06:39 AM.
@ 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!)...
Ok see if you see the problem it should be in this general area!
[mod]Please use [/php] tags instead of quote or code tags. Color codes and spaces properly. ThanksPHP 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 (p == 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) / 8; xCalc
<= ((p.mapRegionX + 6) / 8); xCalc++) {
for (int yCalc = (p.mapRegionY - 6) / 8; yCalc
<= ((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 p, int set, int window, int inter, int off, int len) {
if (p == 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 p, int id, Object[] o, String 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); i >= 0; i--) {
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();
}
Regards,
~GhostSnyper[/mod]
Last edited by GhostSnyper; 20-08-09 at 07:50 AM.
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.
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
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
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 :)
Grundy, please post a proper thread with your issues.
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.