caspa Posted May 31, 2012 Posted May 31, 2012 OnPCLogoutEvent: if(getmapusers("1@pump") == 0) hideoffnpc "MvP Summoner"; announce "MvP room is now availabe.",bc_all; }else if(strcharinfo(3) != "1@pump"){ warp "prontera",150,150; end; is there anything wrong with this? coz i want it to : 1. it kills the monster in the map if the last person in the map log out 2. it announce mvp room is now available if the last person in the map log out 3. it hideoffnpc if the last person in the map log out 4. it warps the person to prontera if they log out and log in again. Quote
KeyWorld Posted May 31, 2012 Posted May 31, 2012 You should test it before ask Missing a "{", missing a "}", bad else location, the announce is send every time a player log out, warp players every time the log out to prontera. Should be something like this: OnPCLogOutEvent: if ( strcharinfo(3) == "1@pump" ) { if ( getmapusers("1@pump") == 0 ) // 0 or 1 ? Does the script is execute before decrement the map counter ? { hideoffnpc "MvP Summoner"; announce "MvP room is now availabe.", bc_all; killmonsterall "1@pump"; } warp "prontera", 150, 150; end; } 1 Quote
Magnetix Posted May 31, 2012 Posted May 31, 2012 (edited) OnPCLogOutEvent: if ( strcharinfo(3) == "1@pump" ) { if ( getmapusers("1@pump") == 0 ) { announce "MvP room is now availabe.", bc_all; killmonsterall "1@pump"; disablenpc "MvP Summoner"; } } // = Mapflag 1@pump mapflag nosave SavePoint I don't know if this will work. I can't find event that triggers when a user leaves a map example warping out of the map. You may want to add a check script for the map every x minutes to get mapusers, in case they leave the map without logging out. Another alternative is to provide an npc to exit the map. Edited May 31, 2012 by Magnetix Quote
Question
caspa
is there anything wrong with this?
coz i want it to :
1. it kills the monster in the map if the last person in the map log out
2. it announce mvp room is now available if the last person in the map log out
3. it hideoffnpc if the last person in the map log out
4. it warps the person to prontera if they log out and log in again.
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.