Jump to content
  • 0

Question

Posted
if (getmapusers("bat_room") >=26){
	warp "SavePoint",0,0;
}

the problem is, when someone come in, that script randomly kick one of 26 player.

what if i want to make last char will be kicked, so the other player who stay inside bat_room cannot disturbed?

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

add the checking condition to your warper npc.

 

already but, it can be bypassed.

so i want to make script that kick player 25th instead of max players are 24.

 

something like Euphy script

// callfunc "Check_IP","<map_name>";
function script Check_IP {

// Get list of accounts with attached character's IP address.
set .@size, query_sql("SELECT `account_id` FROM `login` WHERE `last_ip` = '"+getcharip()+"'",.@aid);

// Passed check if only the attached player is returned.
if (.@size < 2) return;

// Check all online characters using the IP address if they're on the given map.
set .@self, getcharid(3);
for(set .@i,0; .@i<.@size; set .@i,.@i+1) {
if (attachrid(.@aid[.@i])) {
if (strcharinfo(3) == getarg(0)) {
set .@name$, strcharinfo(0);
attachrid(.@self);
mes "Character "+.@name$+" is already logged into Battlegrounds with your IP.";
close;
}
}
}
attachrid(.@self);

// Passed check.
return;
}

but it read of max player, not ip address.

Edited by Psyche

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...