Guest User

Untitled

a guest
May 22nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.87 KB | None | 0 0
  1. local config = {
  2.    cantidad = 1
  3. }
  4.  
  5. local aid = { --actionid, ITEMQEDARA, ITEMQEQITARA
  6.    --Listas
  7.    [5600] = {7168, 2328},
  8.    [5601] = {7588, 2328},
  9.    [5602] = {7591, 2328},
  10.    [5603] = {7620, 2328},
  11.    [5604] = {7589, 2328},
  12.    [5605] = {7590, 2328},
  13.    [5606] = {8472, 2328},
  14.    [5607] = {8473, 2328},
  15.    [5608] = {2273, 2328},
  16.    [5609] = {2274, 2328},
  17.    [5610] = {2271, 2328,
  18.    [5611] = {2269, 2328},
  19.    [5612] = {2268, 2328},
  20.    [5613] = {2262, 2328},
  21.    [5614] = {2261, 2328},
  22.    [5615] = {2260, 2328},
  23.    [5616] = {2310, 2328},
  24.    [5617] = {2311, 2328},
  25.    [5618] = {2313, 2328},
  26.    [5619] = {2315, 2328},
  27.    [5620] = {2289, 2328},
  28.    [5621] = {2288, 2328},
  29.    [5622] = {2287, 2328},
  30.    [5623] = {2286, 2328},
  31.    [5624] = {2285, 2328},
  32.    [5625] = {2278, 2328},
  33.    [5626] = {2277, 2328},
  34.    [5627] = {2308, 2328},
  35.    [5628] = {2305, 2328},
  36.    [5629] = {2304, 2328},
  37.    [5630] = {2303, 2328},
  38.    [5631] = {2302, 2328},
  39.    [5632] = {2301, 2328},
  40.    [5633] = {2295, 2328},
  41.    [5634] = {2293, 2328},
  42.    [5635] = {2292, 2328},
  43.    [5636] = {2291, 2328},
  44.    [5637] = {2290, 2328}
  45. }
  46.  
  47. function onUse(cid, item, fromPosition, itemEx, toPosition)
  48.    local aids = aid[item.actionid]
  49.    if item.itemid == 1945 then
  50.       if aids then
  51.          if doPlayerAddItem(cid, aids[1], config.cantidad, false) == RETURNVALUE_NOERROR then
  52.             if doPlayerRemoveItem(cid, aids[3]) then
  53.                doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, 'Recibiste '..getItemNameById(aids[2])..' acambio de '..getItemNameById(aids[3])..'.')
  54.             else
  55.                doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, 'Necesitas un '..getItemNameById(aids[3])..' para comprar este producto.')
  56.             end
  57.          else
  58.             doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, 'No tienes suficiente capacidad.')
  59.          end
  60.       end
  61.    return true
  62. end
Add Comment
Please, Sign In to add comment