Jump to content
  • 0

Question

Posted (edited)

Hello, I'm doing a protection for tvt event, but I'm trying to get someone to help me? if removing else does not work

 



    public static void AddTvTSpawnInfo(String name, int _x, int _y, int _z)
    {
        if(!CheckTvTSpawnInfo(name))
        {
            String temp = name + ":" + Integer.toString(_x) + ":" + Integer.toString(_y) + ":" + Integer.toString(_z) + ":1";
            TvTPlayerList.add(temp);
        }
        else
        {
            Object[] elements = TvTPlayerList.toArray();
            for(int i=0; i < elements.length ; i++)
            {
                Splitter = ((String) elements[i]).split(":");
                String nameVal = Splitter[0];
                if (name.equals(nameVal))
                {
                    GetTvTSpawnInfo(name);
                    if (_x == xx && _y == yy && _z == zz && _player.isAttackingNow() == false && _player.isCastingNow() == false && _player.isOnline() == true)
                    {
                        ++SameLoc;
                        if (SameLoc >= 4)//Kick after 4 same x/y/z, location checks
                        {
                            //kick here
                            TvTPlayerList.remove(i);
                            _player.logout();
                            return;
                        }
                        else
                        {
                        TvTPlayerList.remove(i);
                        String temp = name + ":" + Integer.toString(_x) + ":" + Integer.toString(_y) + ":" + Integer.toString(_z) + ":" + SameLoc;
                        TvTPlayerList.add(temp);
                        return;
                        }
                    }
                    TvTPlayerList.remove(i);
                    String temp = name + ":" + Integer.toString(_x) + ":" + Integer.toString(_y) + ":" + Integer.toString(_z) + ":1";
                    TvTPlayerList.add(temp);
                }
            }
        }
    }
    

 

hJXIs3V.png

Edited by l2jkain

3 answers to this question

Recommended Posts

  • 0
Posted

It's just a warning, code style. Follow eclipse tip and format your code to be more readable if needed, ctrl shift f. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock