Prawdziwynrtn

Untitled

Jul 1st, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. function onSay(cid, words, param, channel)
  2.  
  3. local storage = 8000
  4. local value = getPlayerStorageValue(cid, storage)
  5.  
  6. local strings, i, position, added, showGamemasters = {""}, 1, 1, false, getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
  7. for _, pid in ipairs(getPlayersOnline()) do
  8. if(added) then
  9. if(i > (position * 7)) then
  10. strings[position] = strings[position] .. ","
  11. position = position + 1
  12. strings[position] = ""
  13. else
  14. strings[position] = i == 1 and "" or strings[position] .. ", "
  15. end
  16. end
  17.  
  18. added = false
  19. if((showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then
  20. if getPlayerStorageValue(pid, storage) == value then
  21. if pid ~= cid then
  22. strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"
  23. i = i + 1
  24. added = true
  25. end
  26. end
  27. end
  28. end
  29.  
  30. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player" .. (i > 1 and "s" or "") .. " online with same saga as you:")
  31. for i, str in ipairs(strings) do
  32. if(str:sub(str:len()) ~= ",") then
  33. str = str .. ""
  34. end
  35.  
  36. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
  37. end
  38.  
  39. return true
  40. end
Add Comment
Please, Sign In to add comment