Jump to content
  • 0

Random kick.


Bradium

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  04/04/13
  • Last Seen:  

I have this problem regarding my BG NPC that auto-kicks player(s) that has the same IP.

 
It boils down to this,
 
2 Players queing for BG on different sides (Red,Blue) , then the BG starts and by the use of this script
 
OnEnterBG:
    set $@Conquest_id1,

 

OnEnterBG:
    set $@Conquest_id2,
 
- Ends script like this
 
bg_destroy $@Conquest_id1;
    set $@Conquest_id1, 0;
 
 bg_destroy $@Conquest_id2;
    set $@Conquest_id2, 0;
 
they get into the bg room, but the script that blocks 2 same IP on the same map removed either of the two from the map.
 
And there my question is, how do I check on who got kicked from the map? Since npc autokicks players more than 1 IP on the same map?
 
     script    Only1perIP    -1,{

OnPCLoadMapEvent:

    // Which maps to check? (remember to add 'loadevent' mapflag at the bottom)

    set .@maps$, "schg_cas06,schg_cas07,schg_cas08,jupe_ele";

    

    if (!compare(","+.@maps$+"," , ","+strcharinfo(3)+",")) end;

    // check for other online characters from their IP

    if (query_sql("SELECT `char`.`name` FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id " +

                 "WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online AND login.account_id!="+getcharid(3), .@name$) > 0)

    {

        // check if they are on the same map

        for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {

            getmapxy .@map$, .@x,.@y,0, .@name$[.@i];

            if (.@map$ == strcharinfo(3)) {

                announce "Sorry but only 1 character per IP is allowed on this map.", bc_blue|bc_self;

                

                warp "SavePoint",0,0;
                    sleep2 1000;


            }

        }

    }
    sleep 2000;
    bg_destroy $@Conquest_id1;
    set $@Conquest_id1, 0;
    bg_destroy $@Conquest_id2;
    set $@Conquest_id2, 0;                
    end;
(This side - it kicks random player with the same IP and removes the id from the bg)
How'd I choose who got out and not removed to the player the $@conquest_id1, or 2?
}



schg_cas06    mapflag    loadevent
schg_cas07    mapflag    loadevent
schg_cas08    mapflag    loadevent

 



 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

announce "Sorry but only 1 character per IP is allowed on this map.", bc_blue|bc_self;
logmes strcharinfo(0)+" was kicked from "+.@map$+" because he/she has the same IP with "+@name$;
warp "SavePoint",0,0;
sleep2 1000;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  04/04/13
  • Last Seen:  

How does that end the BG script? o.O"

It has to be when you get out of the BG, you also end your 

 

   bg_destroy $@Conquest_id1;
    set $@Conquest_id1, 0;

 

So when you login you have

 

OnEnterBG:

    set $@Conquest_id1, ------> right?(From different BG Script)

when the BG ends it will end it like 
 
bg_destroy $@Conquest_id1;
    set $@Conquest_id1, 0;
 
 
So basically when two client with the same IP that queue's on BG; one random client will get kicked, now one will remain in BG. 
 
The one that gets kicked will end the bg
 bg_destroy $@Conquest_id1;

    set $@Conquest_id1, 0;

 

The other one left will still continue doing BG.

 

- Hope this clears everything out.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...