What's new

-Skrypt [TFS 0.4]NPC Mission

Status
Not open for further replies.

MiQi

Advanced User
Joined
Dec 10, 2008
Messages
284
Reaction score
10
Mam pewien problem i jedno pytanie odno?nie kodu .lua

Code:
{name = "[COLOR="Lime"]Frost dragon[/COLOR]", storage = 123456, max = 800, nagroda = {{2160, 50}}},
					{name = "[COLOR="Lime"]Undead dragon[/COLOR]", storage = 123458, max = 1000, nagroda = {{2160, 70}}},
					{name = "Hydra", storage = 123460, max = 1500, nagroda = {{2160, 100}}},
					{name = "[COLOR="Lime"]Grim reaper[/COLOR]", storage = 123462, max = 2000, nagroda = {{2160, 150}}},
					{name = "Demon", storage = 123464, max = 5000, nagroda = {{2148, 200}}},

Kod zaznaczony na zielono s? to potwory, kt?re nie dzia?aj? nie wiem dlaczego, ale domy?lam si?, ?e maja w nazwie 2 s?owa.

2. Jak do nagrody doda? pkt z sms shop.

Za pomoc b?d? wdzi?czny, z g?ry dzi?kuje.
 

Bubin

Senior User
Joined
May 13, 2009
Messages
1,113
Reaction score
169
Age
26
Odp: [TFS 0.4]NPC Mission

2.
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 22221 then
    queststatus = getPlayerStorageValue(cid,22221)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"Otrzymales 10 premium points!")
            doPlayerAddItem(cid,2282,1)
            setPlayerStorageValue(cid,22221,1)
        else
            doPlayerSendTextMessage(cid,22,"Juz Brales 10 premium points!.")
        end
    else
    return false
    end
return true
end
a w actions
Code:
	<action uniqueid="22221" event="script" value="scripts/pkt.lua" />
edytuj sobie w items id 2282 :
Code:
	<item id="2282" article="a" name="Premium Points">
		<attribute key="weight" value="120"/>
	</item>
dodaj sms.lua
Code:
local cfg = 
{
    points = 10,
    effect = CONST_ME_GIFT_WRAPS
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(not isPlayer(itemEx.uid)) then
        return false
    end

    db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. cfg.points .. " WHERE `name` = '" .. getAccountByName(getCreatureName(itemEx.uid)) .. "' LIMIT 1;")
    doCreatureSay(cid, "You have received " .. cfg.points .. " premium points!", TALKTYPE_ORANGE_1, false, nil, toPosition)
    doSendMagicEffect(toPosition, cfg.effect)
    doRemoveItem(item.uid, 1)
    return true
end
potem actions.xml
Code:
	<action itemid="2282" script="scripts/sms.lua" />
u mnie dzia?a.
 

MiQi

Advanced User
Joined
Dec 10, 2008
Messages
284
Reaction score
10
Odp: [TFS 0.4]NPC Mission

nie o to mi chodzi. To ju? mnie nie interesuje ale o co chodzi z tym b??dem.
 
Status
Not open for further replies.
Top