Advertisement
Skymagnum

Untitled

May 10th, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. function onSay(cid, words, param)
  2.  
  3. local T = string.explode(param, ",")
  4.  
  5.     local subType = tonumber(T[3]) and T[3] or 1
  6.     local player = getPlayerByNameWildcard(T[1])
  7.     local itemName = getItemNameById(T[2])
  8.     local itemV = doCreateItemEx(T[2], T[3])
  9.     local weight = getItemWeight(T[2]) * subType
  10.  
  11.     if (tostring(T[1]) and tonumber(T[2])) then
  12.        if player then
  13.           if getPlayerFreeCap(player) > weight then
  14.               doPlayerAddItem(player, T[2], subType)
  15.               doPlayerSendTextMessage(cid, 27, "You has been added " .. subType .. "x " .. itemName .. " to " .. T[1] .. ".")
  16.               doPlayerSendTextMessage(player, 27, "You received " .. subType .. "x " .. itemName .. ".")
  17.           else
  18.               doPlayerSendMailByName(T[1], itemV)
  19.               doPlayerSendTextMessage(cid, 27, "You send " .. subType .. "x " .. itemName .. " to " .. T[1] .. " depots.")
  20.               doPlayerSendTextMessage(player, 27, "You received one items, there's in your depot.")
  21.           end
  22.        else
  23.            doPlayerSendMailByName(T[1], itemV)
  24.            doPlayerSendTextMessage(cid, 27, "You send " .. subType .. "x " .. itemName .. " to " .. T[1] .. " depots.")
  25.        end
  26.     end
  27.  
  28.     return true
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement