• 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!

I really need it ;) - Repping who ever helps me XD!

Wezza

lua nOOb
Joined
May 31, 2008
Messages
2,278
Reaction score
31
Hello, OTLANDERS..

Today I came to request some talkactions, that I really need...
Also there's other thing if MOD.. ALLOWS me to post in 1 thread..

Okay here's the list I need for TALKACTIONS:

- !spells [I want this command to pop up a spell book, showing all spells] - For Players -

- !food [I want this command, to create 5 meat, used for players]

- !commands [I want this command, to pop-up a window, [PAPER - SPELLBOOK, or anything, showing all commands that players can do]

- !staffcommand [I want this command, to do the same as the previous, but to show the staff members what are the available commands they can do on their access]

- !sell [I want this command, to make the players able to sell certain items]
--Also tell me, how to make it add more than one item--


[[By this talkaction,
- !selllist [Shows the the player what he can sell, also shows the price of the item, make a random item example: Golden armor, and the price, so I know how.

_______________
_______________

Okay, the other list I need for ACTIONS:

- I want a switch, that moves stone/magicwall/wall, or anything else..


Thanks for your support,
Mizo.

-[[ I need everything for TFS "Crying Damson", 0.3.4 ]]-
 
Last edited:
!spells
PHP:
function onSay(cid, words, param)
    local count = getPlayerInstantSpellCount(cid)
    local text = ""
    local t = {}
    for i = 0, count - 1 do
        local spell = getPlayerInstantSpellInfo(cid, i)
        if spell.level ~= 0 then
            if spell.manapercent > 0 then
                spell.mana = spell.manapercent .. "%"
            end
            table.insert(t, spell)
        end
    end
    table.sort(t, function(a, b) return a.level < b.level end)
    local prevLevel = -1
    for i, spell in ipairs(t) do
        local line = ""
        if prevLevel ~= spell.level then
            if i ~= 1 then
                line = "\n"
            end
            line = line .. "Spells for Level " .. spell.level .. "\n"
            prevLevel = spell.level
        end
        text = text .. line .. "  " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n"
    end
    doShowTextDialog(cid, 2175, text)
    return TRUE
end
_________________________________________________________________
!food

PHP:
function onSay(cid, words, param)

	if doPlayerRemoveItem(cid,2160,1) == 1 then
		doPlayerAddItem(cid,FOOD ID,100)
	else
		doPlayerSendCancel(cid,"Sorry, but you don\'t have enought money")
	end
end
____________________________________________________________________________________
REP++ IF I HELPED
 
There's already !commands in 0.3.5
Lua:
local config = {
	guildTalksEnabled = getBooleanFromString(getConfigValue('ingameGuildManagement'))
}

function onSay(cid, words, param, channel)
	local playerAccess, t = getPlayerAccess(cid), {}
	for i, talk in ipairs(getTalkActionList()) do
		if(not talk.hide and playerAccess >= talk.access) then
			local tmp = talk.words:sub(1, 1):trim()
			if((guildTalksEnabled or (talk.words ~= "!joinguild" and talk.words ~= "!createguild")) and (tmp == "!" or tmp == "/")) then
				table.insert(t, talk)
			end
		end
	end

	table.sort(t, function(a, b) return a.access > b.access end)
	local lastAccess, str = -1, ""
	for i, talk in ipairs(t) do
		local line = ""
		if(lastAccess ~= talk.access) then
			if(i ~= 1) then
				line = "\n"
			end
			lastAccess = talk.access
		end
		str = str .. line .. talk.words .. "\n"
	end

	doShowTextDialog(cid, 2160, str)
	return true
end
 
!spells
PHP:
function onSay(cid, words, param)
    local count = getPlayerInstantSpellCount(cid)
    local text = ""
    local t = {}
    for i = 0, count - 1 do
        local spell = getPlayerInstantSpellInfo(cid, i)
        if spell.level ~= 0 then
            if spell.manapercent > 0 then
                spell.mana = spell.manapercent .. "%"
            end
            table.insert(t, spell)
        end
    end
    table.sort(t, function(a, b) return a.level < b.level end)
    local prevLevel = -1
    for i, spell in ipairs(t) do
        local line = ""
        if prevLevel ~= spell.level then
            if i ~= 1 then
                line = "\n"
            end
            line = line .. "Spells for Level " .. spell.level .. "\n"
            prevLevel = spell.level
        end
        text = text .. line .. "  " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n"
    end
    doShowTextDialog(cid, 2175, text)
    return TRUE
end
_________________________________________________________________
!food

PHP:
function onSay(cid, words, param)

	if doPlayerRemoveItem(cid,2160,1) == 1 then
		doPlayerAddItem(cid,FOOD ID,100)
	else
		doPlayerSendCancel(cid,"Sorry, but you don\'t have enought money")
	end
end
____________________________________________________________________________________
REP++ IF I HELPED
Why dont you use true instead of 1? and doPlayerRemoveMoney(cid, money) instead of removeitem?
This one better.
Lua:
function onSay(cid, words, param)

    if doPlayerRemoveMoney(cid, 100) == true then
        doPlayerAddItem(cid,2666,5)
    else
        doPlayerSendCancel(cid,"Sorry, but you don\'t have enought money")
    end
end
 
Back
Top Bottom