Java coding problem please take a look

Discussion in 'Programming General' started by Visual Basic Matt, Jul 29, 2008.

Java coding problem please take a look
  1. Unread #1 - Jul 29, 2008 at 6:05 PM
  2. Visual Basic Matt
    Joined:
    Jan 29, 2008
    Posts:
    647
    Referrals:
    2
    Sythe Gold:
    56
    Discord Unique ID:
    223154494878253056

    Visual Basic Matt Apprentice

    Java coding problem please take a look

    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. Unread #2 - Sep 4, 2008 at 6:43 PM
  4. Visual Basic Matt
    Joined:
    Jan 29, 2008
    Posts:
    647
    Referrals:
    2
    Sythe Gold:
    56
    Discord Unique ID:
    223154494878253056

    Visual Basic Matt Apprentice

    Java coding problem please take a look

    Sorry about this OLD POST but, i need an answer... :(
     
  5. Unread #3 - Sep 4, 2008 at 7:57 PM
  6. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Java coding problem please take a look

    ummmm whats the error?
     
  7. Unread #4 - Sep 4, 2008 at 8:20 PM
  8. Visual Basic Matt
    Joined:
    Jan 29, 2008
    Posts:
    647
    Referrals:
    2
    Sythe Gold:
    56
    Discord Unique ID:
    223154494878253056

    Visual Basic Matt Apprentice

    Java coding problem please take a look

    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?

    [​IMG]
     
  9. Unread #5 - Sep 4, 2008 at 10:18 PM
  10. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    Java coding problem please take a look

    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.
     
  11. Unread #6 - Sep 4, 2008 at 10:19 PM
  12. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Java coding problem please take a look

    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:
     
  13. Unread #7 - Sep 5, 2008 at 4:20 PM
  14. Visual Basic Matt
    Joined:
    Jan 29, 2008
    Posts:
    647
    Referrals:
    2
    Sythe Gold:
    56
    Discord Unique ID:
    223154494878253056

    Visual Basic Matt Apprentice

    Java coding problem please take a look

    Thanks so much... *Worked!*
     
  15. Unread #8 - Sep 5, 2008 at 6:07 PM
  16. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Java coding problem please take a look

    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:
     
  17. Unread #9 - Sep 5, 2008 at 8:06 PM
  18. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    Java coding problem please take a look

    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.
     
  19. Unread #10 - Sep 5, 2008 at 8:35 PM
  20. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Java coding problem please take a look

    i was wondering about that too, but i paid no mind to it. D:
     
< Anyone need some work? | Java stuff man >

Users viewing this thread
1 guest


 
 
Adblock breaks this site