Is there an NPC event I can use to detect when player enters a map?

latheesan

New member
Messages
41
Points
0
Age
38
Location
United Kingdom
Emulator
Is there an NPC event I can use to detect when player enters a map?

I want to prevent duel client on event maps, but to be able to do that, I need to first detect user entering a specific map.

How can I go about doing this?

 
- script mapload FAKE_NPC,{
OnPCLoadMapEvent:
sleep2 10; // small delay
if( strcharinfo(3) == "mapname") { // if player goes to map
query_sql("SELECT COUNT(*) FROM `login` WHERE `last_ip` = (SELECT `last_ip` FROM `login` WHERE `account_id` = "+getcharid(3)+")",.@ipcount); // check and count ip
if (.@ipcount >= 2) { // and if yes
warp "prontera",156,184; // warp out
message strcharinfo(0),"Access Deined: No Dual Clienting allowed here"; // and tell why
end;
}
} else {
end;
}
}

<MAPNAME> mapflag loadevent // mapflag for the map you wanna use it

edit: added spoiler. just read you wanted only the eventname. It's OnPCLoadMapEvent. You also need to give the map the loadevent mapflag

 
Last edited by a moderator:
Back
Top