Hello everyone...
I have this problem:
In my server i put that all players may make items with the command /i - The problem is, that i have custom items to gave only in events, but they can make id if the knows the ID... I want to know if there's a way to make that u can't make some items with the command.
Something like:
Idk, but something that make that...
Here i leave my createitems.lua
Hope you can help me!
Thank you!
Greetings.
I have this problem:
In my server i put that all players may make items with the command /i - The problem is, that i have custom items to gave only in events, but they can make id if the knows the ID... I want to know if there's a way to make that u can't make some items with the command.
Something like:
Code:
local notAllowed = {"10022", "7410"}
Idk, but something that make that...
Here i leave my createitems.lua
Code:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
local t = string.explode(param, ",")
local ret = RETURNVALUE_NOERROR
local tmp = getCreaturePosition(cid)
local id = tonumber(t[1])
if(not id) then
id = getItemIdByName(t[1], false)
if(not id) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
return true
end
end
local amount = 100
if(t[2]) then
amount = t[2]
end
local item = doCreateItemEx(id, amount)
if(t[3] and getBooleanFromString(t[3])) then
if(t[4] and getBooleanFromString(t[4])) then
tmp = getPlayerLookPos(cid)
end
ret = doTileAddItemEx(tmp, item)
else
ret = doPlayerAddItemEx(cid, item, true)
end
if(ret ~= RETURNVALUE_NOERROR) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1])
return true
end
doSendMagicEffect(tmp, CONST_ME_MAGIC_RED)
return true
end
Hope you can help me!
Thank you!
Greetings.