• logo_cipsoft
    Nowe serwery zostały otwarte 27 Sie 2025:
    Escura (Retro Open PvP) Mystera (Retro Open PvP) us_logo Penumbra (Retro Open PvP)

Actions Otrzymanie przedmiotu z utrat? GP.

Status
Zamknięty.

Samman

Senior User
Dołączył
Sierpień 23, 2009
Posty
782
Liczba reakcji
39
Witajcie,


Tworzymy plik rewardwithcoin.lua w folderze data/actions/scripts i dodajemy do niego ten skrypt:
PHP:
function onUse(cid, item, frompos, itemEx, topos)
local money = 200
       if getPlayerStorageValue(cid, 7772) >= -1 then
            if getPlayerLevel(cid) >= 30 then
            doPlayerAddItem(cid, 1915, 1)
            doPlayerRemoveMoney(cid, money)
            setPlayerStorageValue(cid, 7772, 1)
            doPlayerSendTextMessage(cid, 25, "Otrzymales magiczny przedmiot!")
            else
            doPlayerSendTextMessage(cid, 25, "Nie masz odpowiedniego poziomu!")
            end
        else
        doPlayerSendCancel(cid, "Juz uzyles tego przedmiotu.")
       end
return true
end

Teraz dodajemy do actions.xml:
PHP:
<action actionid="XX" event="script" value="rewardwithcoin.lua" />
 
Status
Zamknięty.
Do góry