Version 1.0.0
365 downloads
You need at lest rAthena 10e7035bebdbc2ec25a392ee2cf14172ecf169e5 or above! (for old rAthena you should add the pr manually!)
SCRIPT HEADER (INFO)
//===== rAthena Script =======================================
//= getgpmapunits command
//= getipmapunits command
//===== By: ==================================================
//= Sader1992
//= Free!!
// https://rathena.org/board/profile/30766-sader1992/
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= rAthena Project
// https://github.com/sader1992/sader_scripts
//===== Description: =========================================
// getgpmapunits("map"); return the number of players with the same GePard id in the given map. (You must have GePard to work!)
// getipmapunits("map"); return the number of players with the same IP in the given map.
//============================================================
//==== please report any error you find
//============================================================
//============================================================
you should add the functions to your rAthena/npc/other/Global_Functions.txt to work (add it in that file where ever you like, no need for guide for that ?!)
Examples:
scenario ? >
you want a Warper NPC (or maybe event NPC) that allow only one player per IP in the map ?
//==============================================
//NPC EXAMPLE FOR IP FUNCTION
//==============================================
prontera,152,183,5 script Warper IP Test 446,{
if(getipmapunits("prontera") > 0){
mes "you already have a char inside this map";
}else{
warp "prontera",152,183;
}
end;
}
//==============================================
Same as above but per GePard ID not IP
//==============================================
//NPC EXAMPLE FOR GEPARD FUNCTION
//==============================================
prontera,155,183,5 script Warper GePard Test 446,{
if(getipmapunits("prontera") > 0){
mes "you already have a char inside this map";
}else{
warp "prontera",155,183;
}
end;
}
//==============================================
BONUS Test:
pvp warper
prontera,158,183,5 script PVP Warper IP Test 446,{
mes "would you like to teleport to the pvp map?";
if(select("yes:no") == 2)
close;
if(getipmapunits("pvp_n_1-1") > 0){
mes "there is another character with the same ip inside the map!";
mes "only 1 character per IP allowed in this map!";
}else{
warp "pvp_n_1-1",0,0;
}
end;
}