• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Talkaction

Real Vandta

Member
Joined
Jun 16, 2020
Messages
56
Solutions
1
Reaction score
11
Location
Egypt
Hello everyone

can you help me with edit script of talkaction createitem.lua

i want to make the /i donation items, the gamemaster + comminuty manager cannot use /i donation items only for GOD and ADMINS

can help me with that please 🤗🤔🤔

I using TFS 1.0.6
 
Solution
When you PMed me I told you 100 times already that there's nothing such as TFS 1.0.6 and your TFS version is 0.4 from the screenshots/files you sent to me.
I told you in Arabic/English not sure which languages/how many times I have to tell you to understand this.
Anyways you'll have to edit your XML line to work for only admins by changing access.
XML:
<talkaction log="yes" words="/i" access="changethis" event="script" value="createitem.lua"/>
do you mean put access 6?
Post automatically merged:

Lua:
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 pos = getCreaturePosition(cid)
    local banned = {2160,2358}
    local accessToUse = 6

    local x = t[1]
    if not isNumber(x) then
        x = getItemIdByName(t[1], false)
    end
    if isInArray(banned, x) and (getPlayerAccess(cid) < accessToUse) then
            doPlayerSendTextMessage(cid, 27, "Sorry, you may not create this item")
        return true
    end
    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 with 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
            pos = getCreatureLookPosition(cid)
        end

        ret = doTileAddItemEx(pos, 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

    doDecayItem(item)
    if(not isPlayerGhost(cid)) then
        doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
    end



    return true
end

im sorry i didin't see that
Post automatically merged:

moustafa really it worked perfectly thank you so much
 
Back
Top