OnCheck: if ( strcharinfo(3) != "prontera" ) { announce strcharinfo(0)+" has died and back to Save Points.",bc_all; }OnPCLoadMapEvent: deltimer strnpcinfo(0)+"::OnCheck"; if ( strcharinfo(3) == "prontera" ) addtimer 5000,strnpcinfo(0)+"::OnCheck"; end;
OnPCDieEvent: .@map$ = strcharinfo(3); .@char = getcharid(0); if ( .@map$ == "prontera" ) { while ( strcharinfo(3) == .@map$ && !Hp) { sleep 1000; if (isloggedin(.@char)) attachrid(.@char); else break; } if (isloggedin(.@char) && strcharinfo(3) != .@map$) announce strcharinfo(0)+" has died and back to Save Points.",bc_all; } end;OnPCLogoutEvent: if ( .@map$ == "prontera" ) { if (!Hp) announce strcharinfo(0)+" has died and Logout.",bc_all; else announce strcharinfo(0)+" has Logout.",bc_all; } end;
it work fine in my Hercules test server.@@Emistry
The first won't work.
Leaving the map would reset the script and the part after the loop would never get executed.
The second should work, but it is pretty unrealistic since i guess he wants this function global. For OnPCLoadMapEvent you need to add it via Mapflag to all maps which would produce a high server load and some other changes would be required to make it possible at all.
- script OnPCRespawnEvent FAKE_NPC,{ unittalk getcharid(3), "I'm ALIVE !!!"; end;OnPCDieEvent: unittalk getcharid(3), "I'm dead ..."; end;}
We use essential cookies to make this site work, and optional cookies to enhance your experience.