What's new

Skrypty & Kody Nagrody za fragi

Status
Not open for further replies.

xonsterix

User
Joined
Jul 22, 2009
Messages
36
Reaction score
0
Witam, potrzebuje pomocy przy TFS 0.4 chodzi o to ze mam teraz tak zrobione, ze za zabicie gracza wszystkie osoby ktore zaznacza osobe ktora pozniej padnie dostaja 1 Crystac Coin chce to zmienic zeby ta nagrode dostawala tylko osoba ktora dobije gracza.
 

Sh4dy

Advanced User
Joined
Dec 8, 2011
Messages
176
Reaction score
10
Odp: Nagrody za fragi

To nie jest modyfikacja w C++ , tylko skrypt musisz poda? i wystarczy zmieni? funkcje.
 

xonsterix

User
Joined
Jul 22, 2009
Messages
36
Reaction score
0
Odp: Nagrody za fragi

function onKill(cid, target)
if cid ~= target and isPlayer(target) then
if getPlayerIp(cid) == getPlayerIp(target) then
doCreatureAddHealth(cid, -20)
doCreatureAddMana(cid, -20)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.')
else
doPlayerAddItem(cid, 5944, 1)
doPlayerAddItem(cid, 2160, 1)
doCreatureSetSkullType(target, 0)
addEvent(setSkullColor, 100, cid)
end
end
return true
end
 

Quomak

Senior User
Joined
Jul 15, 2010
Messages
631
Reaction score
40
Age
10
Odp: Nagrody za fragi

Code:
function onKill(cid, target, lastHit)
        if isPlayer(cid) == TRUE and isPlayer(target) == TRUE and lastHit == TRUE then
            if config.t == TRUE then
                doPlayerAddMoney(cid, config.c)
            else
                for i = 1, #config.item do
                    doPlayerAddItem(cid, config.item[i], 1)
                end
            end
        end
    return TRUE
end

http://tibia.net.pl/threads/457028-Frag-Reward


Ewentualnie:

W creaturescripts/scripts utw?rz fragreward.lua:

Code:
    local config = {
    money = TRUE, --True jezeli nagroda ma byc kasa
    ilekasy = 600, --jezeli w money dales true to tu wpisz ilosc
    item = {2160, 2159} --jezeli w money dales cos innego niz true wtedy wpisz tu jakie ma dawac itemy lub item, jezeli jeden item to wpisz tylko = ID
    }
     
     
    function onKill(cid, target, lastHit)
    if isPlayer(cid) == TRUE and isPlayer(target) == TRUE and lastHit == TRUE then
    if config.money == TRUE then
    doPlayerAddMoney(cid, config.ilekasy)
    else
    for i = 1, #config.item do
    doPlayerAddItem(cid, config.item[i], 1)
    end
    end
    end
    return TRUE
    end

w creturescript.xml dodaj:

Code:
    <event type="kill" name="FragReward" event="script" value="fragreward.lua"/>

W login.lua przed ostatnim endem wklej:

Code:
    registerCreatureEvent(cid, "FragReward")


Oba skrypty pochodz? z tego forum.
 
Status
Not open for further replies.
Top