Guest User

Untitled

a guest
Sep 29th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. quest zapisLokalizacji begin
  2. state start begin
  3. function updateClientInfo()
  4. cmdchat("SaveIntoConstInfo "..pc.getqf("idx_1").."|"..pc.getqf("local_x_1").."|"..pc.getqf("local_y_1").." "..pc.getqf("idx_2").."|"..pc.getqf("local_x_2").."|"..pc.getqf("local_y_2").." "..pc.getqf("idx_3").."|"..pc.getqf("local_x_3").."|"..pc.getqf("local_y_3").." "..pc.getqf("idx_4").."|"..pc.getqf("local_x_4").."|"..pc.getqf("local_y_4").." "..pc.getqf("idx_5").."|"..pc.getqf("local_x_5").."|"..pc.getqf("local_y_5"))
  5. end
  6. when login begin
  7. cmdchat("SaveQID "..q.getcurrentquestindex())
  8. zapisLokalizacji.updateClientInfo()
  9. end
  10. when info or button begin
  11. local dane = podzial_tekstu(q.get_input2(), "|")
  12.  
  13. if tostring(dane[1]) == "read" or tostring(dane[1]) == "save" then
  14. if tonumber(dane[2]) <= 5 and tonumber(dane[2]) >= 1 then
  15. local index = pc.getqf("idx_"..tonumber(dane[2]))
  16. if tostring(dane[1]) == "read" then
  17. if index == 0 then
  18. syschat("<Teleportacja> Nic nie jest zapisane w tym miejcu!")
  19. return
  20. end
  21. pc.warp(pc.getqf("global_x_"..tonumber(dane[2]))*100, pc.getqf("global_y_"..tonumber(dane[2]))*100)
  22. else
  23. local idxForbidden = {220, 214, 213, 212, 211, 250, 71, 72, 73, 193, 5, 25, 45, 75, 76, 77, 78, 80, 6, 109}
  24. if table_is_in(idxForbidden, pc.get_map_index()) or pc.in_dungeon() or pc.get_channel_id() == 99 then
  25. syschat("<Teleportacja> Nie możesz utworzyć zapisu na tej mapie!")
  26. return
  27. end
  28. syschat("<Teleportacja> Pomyślnie utworzono zapis na tej pozycji!")
  29.  
  30. pc.setqf("idx_"..tonumber(dane[2]), pc.get_map_index())
  31. pc.setqf("global_x_"..tonumber(dane[2]), pc.get_x())
  32. pc.setqf("global_y_"..tonumber(dane[2]), pc.get_y())
  33. pc.setqf("local_x_"..tonumber(dane[2]), pc.get_local_x())
  34. pc.setqf("local_y_"..tonumber(dane[2]), pc.get_local_y())
  35. zapisLokalizacji.updateClientInfo()
  36. end
  37. end
  38. end
  39. end
  40. end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment