Advertisement
RaffaeL_RsK

check_blocked_items

Jun 6th, 2020 (edited)
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. -----------------------------------------------------
  2. --                Quest Check items                --
  3. --             [RaffaeL] - 28.05.2019              --
  4. --           VERIFICA ITEMELE ECHIPATE             --
  5. --      SI RETURNEAZA JUCATORUL IN PRIMA HARTA     --
  6. -- IN CAZUL IN CARE CONDITIA IMPUSA ESTE ADEVARATA --
  7. -----------------------------------------------------
  8. quest banned_item_check begin
  9.     state start begin
  10.         function Check_items()
  11.             local mapIndex = {63, 113, 114} -- aici adaug map_index pentru hartile in care vrei sa actioneze
  12.             local wearPos = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 20, 21, 22} -- aici nu se modifica
  13.             local blockedItems = {
  14.                 11209, 11409, 11609, 11809,
  15.                 10, 19, 180, 189
  16.             } -- codul itemelor care vor fi blocate
  17.  
  18.             for m = 1, table.getn(mapIndex), 1 do
  19.                 for i = 1, table.getn(blockedItems), 1 do
  20.                     for w = 1, table.getn(wearPos), 1 do
  21.                         if (pc.get_map_index(mapIndex[m]) == true) then
  22.                             if (pc.get_wear(wearPos[w]) == blockedItems[i]) then
  23.                                 chat("Ai echipate iteme care sunt interzise in aceasta harta")
  24.                                 if (pc.get_sex() == 0) then
  25.                                     chat("Vei fi teleportat in prima harta a regatului tau.")
  26.                                 else
  27.                                     chat("Vei fi teleportata in prima harta a regatului tau.")
  28.                                 end
  29.                             warp_to_village()
  30.                             return
  31.                             end
  32.                         end
  33.                     end
  34.                 end
  35.             end
  36.             return mapIndex, wearPos, blockedItems
  37.         end
  38.  
  39.         when login or enter begin
  40.         local t = 5
  41.             loop_timer("ITEM_CHECK", t)
  42.             banned_item_check.Check_items()
  43.         end
  44.  
  45.         when ITEM_CHECK.timer begin
  46.             banned_item_check.Check_items()
  47.         end
  48.     end
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement