Did you try something like...
PHP Code:
function onPlayerLogout(pl) {
pl.clientr.lastGuild = pl.guild;
}
combined with:
PHP Code:
function onPlayerLogin(pl) {
pl.guild = pl.clientr.lastGuild;
}
If that doesn't work, try a simple delay on the onPlayerLogin, such as:
PHP Code:
function onPlayerLogin(pl) {
scheduleEvent("fixGuild", 1, pl);
}
function onFixGuild(pl) {
pl.guild = pl.clientr.lastGuild;
}