Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var player_array = [];
- jist_hook(‘join’, function(player) {
- var ply = { index: player.Infex , name: player.Name, lastx: player.TileX, lasty: player.TileY, afktime: 0 }
- player_array.push(ply)
- });
- var afk_warp = add_recurring(0, 0, 1, function() {
- for var i = 0; i < player_array.length; i++ {
- var ply = get_player(player_array[i].name);
- if (tshock_player_in_region(player_array[i].name, "AFK") == false) {
- if player_array[i].lastx == ply.TileX && player_array[i].lastY == ply.TileY {
- ply.afktime++
- }
- } else if (ply.afktime > 300) {
- execute_command(ply, "/warp afk")
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement