Skip to content

Help aCis

Featured Replies

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

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.