Hello, I'm trying to kick idle players but it's not working.
Well, when player logins it creates a timer (of 5 seconds lol, that's for testing) when timer is over should compare the player position and if the player didn't move it kicks.
I'm having trouble attaching the RID to OnKick event
here's the script
OnPCLoginEvent:
query_sql "SELECT `last_map`,`last_x`,`last_y` FROM `char` WHERE `char_id` = "+getcharid(0), @map$, @x, @y;
addtimer ( 5000 ),strnpcinfo(0)+"::OnKick";
end;
OnKick:
query_sql "SELECT `last_map`,`last_x`,`last_y` FROM `char` WHERE `char_id` = "+getcharid(0), @map2$, @x2, @y2;
if (@map$ == @map2$
&& @x == @x2
&& @y == @y2)
{
atcommand "@kick "+strcharinfo(0);
deltimer strnpcinfo(0)+"::OnKick";
end;
}
}
addtimer ( 5000 ),strnpcinfo(0)+"::OnKick";
end;