Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. local localBrowser  = createBrowser(281.117, 500, true, false)
  2.  
  3. setBrowserAjaxHandler(localBrowser, "ajax", function(get, post)
  4.     local ret = false
  5.    
  6.     fuckDebug("@LUA-AJAX: "..post['action'])
  7.    
  8.     if (post['action'] == "onlinePlayers") then
  9.         local arr = {}
  10.         for k, v in pairs(getElementsByType("player")) do
  11.             table.insert(arr, getPlayerName(v))
  12.         end
  13.         local json = JSON:encode(arr, nil, {stringsAreUtf8=true})
  14.         ret = json
  15.     end
  16.    
  17.     return ret
  18. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement