This is what I use for all my jailing needs ....
this on NPC Character:
NPC Code:
//NPC made by Nyght2k1
if (playerchats && startswith(jail player,#c)) {
if (strcontains(#g,GP)) {
tokenize #c;
setstring server.jailaccount,#t(2);
}
}
if (playerchats && startswith(unjail player,#c)) {
if (strcontains(#g,GP)) {
tokenize #c;
setstring server.unjailaccount,#t(2);
}
}
this on System NPC:
NPC Code:
if (strequals(#a,#s(server.jailaccount)) {
set jailed;
}
if (jailed && !strequals(#L,jaillevel.graal)) {
setlevel jaillevel.graal;
}
if (strequals(#a,#s(server.unjailaccount)) {
set unjailed;
}
if (unjailed && strequals(#L,jaillevel.graal)) {
setlevel onlinestartlocal.graal;
}