• Log in or sign up for an account here: https://www.sythe.org/login

Java coding problem please take a look

Visual Basic Matt

Apprentice
Joined
Jan 29, 2008
Sythe Gold
56
Messages
647
Location
Evurar
I know this is runescape server development but it's in visual Java# So I thought id post it here. I can't seem to figure out what is wrong with this code here. As you can see its for c wars. I could use some help here. Just please correct the code for me although I have nothing to reward you but a little Thank you.
Code:
if (objectID == 4406) //Saradomin Exit + if has Zammy flag
	if (playerHasItemAmount(4039, 1) == false)
{
    teleportToX = 2440; //Teleport to lobby
	teleportToY = 3095; //Teleport to lobby
	heightLevel = 0;    //Teleport to lobby
	playerIsSaradomin = false; //Remove player from team
	//All this code below to make sure they dont leave with anything they got here.
	deleteItem(675, getItemSlot(675), 28);//Rockpick
	deleteItem(4051, getItemSlot(4051), 28);//ToolBox
	deleteItem(7155, getItemSlot(4155), 28);//Rope
	deleteItem(4045, getItemSlot(4042), 28);//Explosive Potion
	deleteItem(4043, getItemSlot(4043), 28);//Rock
	deleteItem(4042, getItemSlot(4042), 1);//Cape-Hood
	deleteItem(4067, getItemSlot(4067), 100);//Tickets
	//Until Here.
	sendMessage("You left the Saradomin Team.");
}
else
sendMessage("You Cannot Leave with the Zamorak Flag!");
}

if (objectID == 4407) //Zamorak Exit + if has Sara flag
	{
	if (playerHasItemAmount(4037, 1) == false)
teleportToX = 2440; //Teleport to lobby
teleportToY = 3085; //Teleport to lobby
heightLevel = 0; //Teleport to lobby
playerIsZamorak = false; //Remove player from team
//All this code below to make sure they dont leave with anything they got here.
deleteItem(675, getItemSlot(675), 28);//Rockpick
deleteItem(4051, getItemSlot(4051), 28);//ToolBox
deleteItem(7155, getItemSlot(4155), 28);//Rope
deleteItem(4045, getItemSlot(4042), 28);//Explosive Potion
deleteItem(4043, getItemSlot(4043), 28);//Rock
deleteItem(4042, getItemSlot(4042), 1);//Cape-Hood
deleteItem(4067, getItemSlot(4067), 100);//Tickets
deleteItem(4067, getItemSlot(4067), 100);//Tickets
//Until Here.
sendMessage("You left the Zamorak Team.");
}
 else 
sendMessage("You Cannot Leave with the Saradomin Flag!");
{
I will highly appreciate your help. :)
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
ummmm whats the error?
 
Taking pic of it please wait...

Edit: Here's the picture of what it gets. 100 errors :( "When I take the code out it goes away" Any suggestions?

errorpic.jpg
 
Use your brackets ALWAYS with your Ifs and Elses otherwise you get errors (that's what the interface or enum error indicates - something that was left unclosed). I can't help you until you post the entire file code as it seems to finish with an opening bracket "{"... Although maybe this will open your eyes as to what's wrong.
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
Code:
if (objectID == 4406) //Saradomin Exit + if has Zammy flag
{
	if (playerHasItemAmount(4039, 1) == false)
{
    teleportToX = 2440; //Teleport to lobby
	teleportToY = 3095; //Teleport to lobby
	heightLevel = 0;    //Teleport to lobby
	playerIsSaradomin = false; //Remove player from team
	//All this code below to make sure they dont leave with anything they got here.
	deleteItem(675, getItemSlot(675), 28);//Rockpick
	deleteItem(4051, getItemSlot(4051), 28);//ToolBox
	deleteItem(7155, getItemSlot(4155), 28);//Rope
	deleteItem(4045, getItemSlot(4042), 28);//Explosive Potion
	deleteItem(4043, getItemSlot(4043), 28);//Rock
	deleteItem(4042, getItemSlot(4042), 1);//Cape-Hood
	deleteItem(4067, getItemSlot(4067), 100);//Tickets
	//Until Here.
	sendMessage("You left the Saradomin Team.");
}
}
else
{
sendMessage("You Cannot Leave with the Zamorak Flag!");
}

if (objectID == 4407) //Zamorak Exit + if has Sara flag
	{
	if (playerHasItemAmount(4037, 1) == false)
{
teleportToX = 2440; //Teleport to lobby
teleportToY = 3085; //Teleport to lobby
heightLevel = 0; //Teleport to lobby
playerIsZamorak = false; //Remove player from team
//All this code below to make sure they dont leave with anything they got here.
deleteItem(675, getItemSlot(675), 28);//Rockpick
deleteItem(4051, getItemSlot(4051), 28);//ToolBox
deleteItem(7155, getItemSlot(4155), 28);//Rope
deleteItem(4045, getItemSlot(4042), 28);//Explosive Potion
deleteItem(4043, getItemSlot(4043), 28);//Rock
deleteItem(4042, getItemSlot(4042), 1);//Cape-Hood
deleteItem(4067, getItemSlot(4067), 100);//Tickets
deleteItem(4067, getItemSlot(4067), 100);//Tickets
//Until Here.
sendMessage("You left the Zamorak Team.");
}
}
 else 
{
sendMessage("You Cannot Leave with the Saradomin Flag!");
}

Try that? D:
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
you need to make sure that if you have a {, you also have a }, and that each if statement needs an { after it and a } at the end of it. D:
 
Member of the Month Winner
Sythe's 10th Anniversary
Wait, by Java# do you mean Microsoft J#?

J# is a language created by Microsoft to help Java developers transfer over to .Net, pretty much. The languages aren't really the same.
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
Wait, by Java# do you mean Microsoft J#?

J# is a language created by Microsoft to help Java developers transfer over to .Net, pretty much. The languages aren't really the same.

i was wondering about that too, but i paid no mind to it. D:
 
Runescape Gamblingrunescape gambling
Back
Top