What's new

Poszukuje skryptu! Nagroda za wbicie 100 LVL'u!

Status
Not open for further replies.

Sinres

Active User
Joined
Apr 15, 2008
Messages
130
Reaction score
6
Witam, poszukuje skryptu kt?ry za wbicie 100 lvl daje dany item.
Mam tutaj pewien skrypt ale on co? nie dzia?a ;/
Code:
function onAdvance(cid)
	if getPlayerLevel(cid) == 5000 then
		addPlayerItem(cid, 2160, 50)
 else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulation! You get 50 CC")
    end
    return true
end
Prosz? o pomoc!
Pozdrawiam, Sinres!

Notka moderatorska:
Z?y dzia?, przenosz?.
 
T

Tairens

Guest
Odp: Poszukuje skryptu! Nagroda za wbicie 100 LVL'u!

Code:
local config =
{
storage = 56709,
item = {2160,50},
level = 100,
}
function onAdvance(cid, skill, oldLevel, newLevel)
local storage = getPlayerStorageValue(cid, config.storage)
	if (skill == SKILL__LEVEL and newLevel == config.level and storage == -1) then
		addPlayerItem(cid, config.item[1], config.item[2])
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulation! You get 50 CC")
		setPlayerStorageValue(cid, config.storage, 1)
    end
    return true
end
 

Sinres

Active User
Joined
Apr 15, 2008
Messages
130
Reaction score
6
Odp: Poszukuje skryptu! Nagroda za wbicie 100 LVL'u!

Jak mam to zainicjowa? w creaturescripts.xml?
Code:
	<event type="advance" name="advence" event="script" value="advence.lua"/>
?
 
T

Tairens

Guest
Odp: Poszukuje skryptu! Nagroda za wbicie 100 LVL'u!

Dodaj to co wy?ej poda?e?, a w login lua:
Code:
registerCreatureEvent(cid, "advence")
 

Sinres

Active User
Joined
Apr 15, 2008
Messages
130
Reaction score
6
Odp: Poszukuje skryptu! Nagroda za wbicie 100 LVL'u!

Oka dzi?ki za pomoc! Repucik leci :)
 

Sinres

Active User
Joined
Apr 15, 2008
Messages
130
Reaction score
6
Odp: Poszukuje skryptu! Nagroda za wbicie 100 LVL'u!

Skrypt nie dzia?a :(((( Skrypt nie dzia?a :((((
 

bivan

User
Joined
Oct 26, 2008
Messages
18
Reaction score
0
Odp: Poszukuje skryptu! Nagroda za wbicie 100 LVL'u!

Prosz? dzia?aj?cy skrypt:
Code:
local config =
{
storage = 1111,
item = {2160,10},
level = 50
}
function onAdvance(cid, skill, oldLevel, newLevel)
local storage = getPlayerStorageValue(cid, config.storage)
	if (skill == SKILL__LEVEL and newLevel == config.level and storage == -1) then
		doPlayerAddItem(cid, config.item[1], config.item[2])
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulation! You got 10 crystal coins")
		setPlayerStorageValue(cid, config.storage, 1)
    end
    return true
end
 

Yahuzi

User
Joined
Jun 16, 2009
Messages
23
Reaction score
1
Odp: Poszukuje skryptu! Nagroda za wbicie 100 LVL'u!

Odswiezam!
To cos w login.lua:
Code:
Error: [CreatureEvent::configureEvent] No valid type for creature event.advance
Warning: [BaseEvents::loadFromXml] Can not configure event

Prosz? o pomoc, tak?e poszukuj? tego skryptu!
 

Maniucza

Advanced User
Joined
Jan 18, 2009
Messages
374
Reaction score
57
Odp: Poszukuje skryptu! Nagroda za wbicie 100 LVL'u!

Witam, prosze was bardzo,
Data/creaturescripts/NAZWA.lua
PHP:
local cfg =
{
	s = 1111,
	i = 2160
	l = 50
}
function onAdvance(cid, skill, oldLevel, newLevel)
	if (skill == SKILL__LEVEL) and (newLevel == cfg.l) and (getPlayerStorageValue(cid, cfg.s) ~= 1) then
		doPlayerAddItem(cid, cfg.i, 10)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulation! You got 10 crystal coins")
		setPlayerStorageValue(cid, cfg.s, 1)
    end
    return true
end

Data/creaturescripts/login.lua
PHP:
registerCreatureEvent(cid, "advence")

Data/creaturescripts.xml
PHP:
	<event type="advance" name="advence" event="script" value="NAZWA.lua"/>

POzdrawiam.
 
Last edited:
Status
Not open for further replies.
Top