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? }
Question
Bradium
I have this problem regarding my BG NPC that auto-kicks player(s) that has the same IP.
Link to comment
Share on other sites
2 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.