• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Prosze o pomysły !

a co tutaj jest do testowania? :O

Code:
function onKill(cid, target)
    local killCount = getPlayerStorageValue(cid, 6512)
    if(killCount > 999)then return true end

    setPlayerStorageValue(cid, 6512, killCount + 1)
    return true
end

function onUse(cid, item)
    local killCount = getPlayerStorageValue(cid, 6512)
    if(killCount < 1000)then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Jestes nob!")
        return true
    end

    doPlayerAddExp(cid, 1000)
    doPlayerAddItem(cid, 2160, 1)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "gz")
    setPlayerStorageValue(cid, 6512, 0)
    return true
end

jak cos pominalem to sorks, pisalem w tym malym boxie ;[

Ja zawsze najpierw kopiuje taba i potem pisze w malym boxie, heh.
 
a co tutaj jest do testowania? :O

Code:
function onKill(cid, target)
    local killCount = getPlayerStorageValue(cid, 6512)
    if(killCount > 999)then return true end

    setPlayerStorageValue(cid, 6512, killCount + 1)
    return true
end

function onUse(cid, item)
    local killCount = getPlayerStorageValue(cid, 6512)
    if(killCount < 1000)then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Jestes nob!")
        return true
    end

    doPlayerAddExp(cid, 1000)
    doPlayerAddItem(cid, 2160, 1)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "gz")
    setPlayerStorageValue(cid, 6512, 0)
    return true
end

jak cos pominalem to sorks, pisalem w tym malym boxie ;[

W Google Chrome mozna ten box powiekszac! :D
 
marcin, a czy jeśli zabijemy 1000 demonów i jeszcze będziemy zabijali to nam dalej będzie naliczało? i czy można użyć to więcej razy niż jeden, mając więcej 'task itemów'?

i gdzie jest informacja o tym ile mamy zabitych demonow?
 
@Paxton:

/data/talkactions/talkactions.xml
Code:
<talkaction words="!gps" event="script" value="gps.lua"/>

/data/talkactions/scripts/gps.lua
Code:
function onSay(cid, words, param, channel)
	if(channel == CHANNEL_DEFAULT) then
		local tmpParam = string.explode(param, ",")
		if(#tmpParam == 3) then
			for i = 1, 3 do
				doCreatureSetStorage(cid, 12000 + i, tmpParam[i])
			end
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[GPS] Done.")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[GPS] Usage !gps x, y, z")
		end
	end
	return true
end

/data/creaturescripts/scripts/login.lua
Code:
registerCreatureEvent(cid, "gps")

/data/creaturescripts/creaturescripts.xml
Code:
<event type="think" name="gps" event="script" value="gps.lua"/>

/data/creaturescripts/scripts/gps.lua
Code:
local dirs = {
	[NORTH] = "UP",
	[EAST] = "RIGHT",
	[SOUTH] = "DOWN",
	[WEST] = "LEFT",
	[SOUTHWEST] = "<V",
	[SOUTHEAST] = "V>",
	[NORTHWEST] = "<^",
	[NORTHEAST] = "^>"
}

function onThink(cid, interval)
	for i = 1, 3 do
		if(getCreatureStorage(cid, 12000 + i) < 1) then
			return true
		end
	end

	local selfPos = getCreaturePosition(cid)
	doSendAnimatedText(selfPos, dirs[getDirectionTo(selfPos, {x = getCreatureStorage(cid, 12001), y = getCreatureStorage(cid, 12002), z = getCreatureStorage(cid, 12003)})], TEXTCOLOR_WHITE)
	return true
end

Powinno dzialac ^_^

Ale ty Pro jesteś :D
Fajny skrypcik, ale jest mały bug, gdy się staje na danej pozycji, skrypt wywala "UP". :)
 
marcin, a czy jeśli zabijemy 1000 demonów i jeszcze będziemy zabijali to nam dalej będzie naliczało? i czy można użyć to więcej razy niż jeden, mając więcej 'task itemów'?

i gdzie jest informacja o tym ile mamy zabitych demonow?

mi wyszło tak ;<
Code:
local monsters =  {
        ["demon"] = 9545,
}
function onKill(cid, target)
        if(isPlayer(target) ~= true and isPlayer(cid)) then
                local name = getCreatureName(target)
                local monster = monsters[string.lower(name)]
                if(monster) then
                        local killedMonsters = getPlayerStorageValue(cid, monster)
                        if(killedMonsters < 1000) then
                                killedMonsters = 1
                        end
        return true
end
						
						

						
						
						
function onUse(cid, item, fromPosition, itemEx, toPosition)
                local monster = monsters[string.lower(name)]
                if(monster) then
                local killedMonsters = getPlayerStorageValue(cid, monster)
		if item.itemid == xxxx then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " " .. name .. "'s.")
			elseif(killedMonsters == 1000) then 
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Gratulacje zabiles 1000 " .. name .. "'s.")
				doPlayerAddMoney(cid, 20000) == TRUE then
				doPlayerSendTextMessage(cid, 19,"Dostales nagrode!")
				doSendMagicEffect(getPlayerPosition(cid), 27)

                end
        end
        return true
end

sprawdz
 
mi wyszło tak ;<
Code:
local monsters =  {
        ["demon"] = 9545,
}
function onKill(cid, target)
        if(isPlayer(target) ~= true and isPlayer(cid)) then
                local name = getCreatureName(target)
                local monster = monsters[string.lower(name)]
                if(monster) then
                        local killedMonsters = getPlayerStorageValue(cid, monster)
                        if(killedMonsters < 1000) then
                                killedMonsters = 1
                        end
        return true
end
						
						

						
						
						
function onUse(cid, item, fromPosition, itemEx, toPosition)
                local monster = monsters[string.lower(name)]
                if(monster) then
                local killedMonsters = getPlayerStorageValue(cid, monster)
		if item.itemid == xxxx then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " " .. name .. "'s.")
			elseif(killedMonsters == 1000) then 
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Gratulacje zabiles 1000 " .. name .. "'s.")
				doPlayerAddMoney(cid, 20000) == TRUE then
				doPlayerSendTextMessage(cid, 19,"Dostales nagrode!")
				doSendMagicEffect(getPlayerPosition(cid), 27)

                end
        end
        return true
end

sprawdz

You missed "end" okx
 
Back
Top