• logo_cipsoft
    Nowe serwery zostały otwarte 19 Lut 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

Skrypty & Kody witam poszukuje skrytpu

Status
Zamknięty.

maxadi

New User
Dołączył
Lipiec 5, 2008
Posty
2
Liczba reakcji
0
poszukuje skryptu ktory dzialal by nastepujaco: przyklad, zabije 100 demonow daje nagrode, za zabicie 300demonow tez daje xx nagrode, a zarazem liczy potwory, z tym ze kod ten powinien zawierac licznik do kazdego potwora. prosze o pomoc
 
Odp: witam poszukuje skrytpu

ustaw tablice
Kod:
  function onKill(cid, target, lastHit)

local questCreatures =
{
        ["wolf"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15000, killsRequired = 200, raceName = "Wolf"},
        ["demon"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15001, killsRequired = 200, raceName = "Demon"},

}

local creature = questCreatures[getCreatureName(target)]
       
        if creature then
                if(isPlayer(target) == true) then
                        return true
                end
                if getPlayerStorageValue(cid, creature.questStarted) > 0 then
                        if getPlayerStorageValue(cid, creature.questStorage) < creature.killsRequired then
                                if getPlayerStorageValue(cid, creature.questStorage) < 0 then
                                        doPlayerSetStorageValue(cid, creature.questStorage, 0)
                                end

                                if getPlayerStorageValue(cid, creature.creatureStorage) < 0 then
                                        doPlayerSetStorageValue(cid, creature.creatureStorage, 0)
                                end
                                doPlayerSetStorageValue(cid, creature.questStorage, getPlayerStorageValue(cid, creature.questStorage) + 1)
                                doPlayerSetStorageValue(cid, creature.creatureStorage, getPlayerStorageValue(cid, creature.creatureStorage) + 1)
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" .. getPlayerStorageValue(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getPlayerStorageValue(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
                        end
                end
        end
        return true
end
 
Status
Zamknięty.
Do góry