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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...