• 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"/>
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"/>
 
Solution
I understand but if you know evolera Org the owner is activate the /i, to the gamemaster and cm but the gamemaster and cm make /i

but the reason cm and gm cannot create donation items
 
You mean they can create all in-game items except donation items? And if you understand please stop writing TFS 1.0.6 already.
 
Try adding this line to your createitem script and change the ids.
Lua:
local DonationItemIds = {
    2203, 2260, 3120
}
    if isInArray(DonationItemIds, item.itemid) == true then
        return false
    end
 
PHP:
function onSay(cid, words, param, channel)
    if(param == '') then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return true
    end

    local t = split(param, ',')
    local ret = RETURNVALUE_NOERROR
    local pos = 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
            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
 
 
bro it worked but i have a reason, im owner and i cannot use /i for these items? view this link and u will see = Screenshot (https://prnt.sc/uo1nmz)
Post automatically merged:

i dont want banned items from create /i, no no i want only Owner can creating this the items, gm + cm cannot create this items
 
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
 
Last edited:
What is the access of those groups? it shouldn't work for players with access lower than 5
 
Edited it, Shouldn't work for any players with access lower than 5.
What is your Gamemaster/Community manager access (not group id)
 
How about God/Administrator? 6 and 7?
Anyways I edited it everyone who's lower than access 6 won't be able to use it.
 
Because I can't understand if you tested it or not, I had to test the script by myself in-game and its working perfect as it should.
Characters with access 6+ will be able to create the banned items or (Donation items).
Characters with access < 6 won't be able to create the banned items or (Donation items).
All you have to do is replacing your createitem script with the one above and add whatever items you need to banned.
 
Back
Top