What's new

Skrypt pomocy

Status
Not open for further replies.

drozd001

Advanced User
Joined
Dec 28, 2008
Messages
209
Reaction score
17
Wie ktos moze czemu moj skrypt nie dziala ?
Dodaje do szpital.lua kod.
Code:
-- Skrypt by Drozd --
function onStepIn(cid, item, pos)
local mana = getPlayerMana(cid)
local hp = getPlayerHealth(cid)
local kill = (mana+hp)-2
local gdzieTP = {x=1000, y=1000, z=7} 
if item.uid == 19780 then
if getPlayerStorageValue(cid,2010) == 22 then
doTeleportThing(cid, gdzieTP)
doSendMagicEffect(gdzieTP, 2)
doPlayerAddHealth(cid,-kill)
setPlayerStorageValue(cid, 2010, 23)
end
end
end

Nastepnie do Movements.xml kod:
Code:
<movement event="StepIn" uniqueid="19780" script="szpital.lua"/>
Potem ustawiam w map editorze kratke o unique id 19780
I gdy na nia staje, a storage value mam wlasciwe. Nic sie nie dzieje. Zmienialem tez skrypt zeby bylo widac problem. Czyli dodalem else i jakis tam przykladowy napis. Ale nawet po wykonaniu tej czynnosci nadal nic.
Jesli ktos wie czemu nie dziala to bardzo prosze o pomoc.
Dam +
 

drozd001

Advanced User
Joined
Dec 28, 2008
Messages
209
Reaction score
17
Odp: Skrypt pomocy

Szybki refresh.
Pomaga? to dam +
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Skrypt pomocy

PHP:
<movement event="StepIn" uniqueid="19780" script="szpital.lua"/>
Na:
PHP:
<movement event="StepIn" uniqueid="19780" event="script" value="szpital.lua"/>
 

drozd001

Advanced User
Joined
Dec 28, 2008
Messages
209
Reaction score
17
Odp: Skrypt pomocy

Dalej nie idzie :/
A to szkoda. Strasznie by mi sie przyda? ten srkypt. Ale dziwne, inne wszystkie dzia?aj?, a ten jak na z?o?? nie :p
Mo?e ma kto? jeszcze jakie? propozycje jak to naprawi? ?

Dodam, ?e sprawdza?em nazwy wszystkich plik?w po kilka razy wi?c w tym problemu te? nie ma

PS: Po dodaniu tego event="script" silnik nie ?azi w og?le. Jest b??d w attribute event.
 
Last edited:

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Skrypt pomocy

PHP:
function onStepIn(cid, item, position, fromPosition)
local mana = getPlayerMana(cid)
local hp = getPlayerHealth(cid)
local kill = (mana+hp)-2
local gdzieTP = {x=1000, y=1000, z=7} 
	if item.uid == 19780 then
		if getPlayerStorageValue(cid, 2010) == 22 then
			doPlayerAddHealth(cid, -kill)
			setPlayerStorageValue(cid, 2010, 23)
			doTeleportThing(cid, gdzieTP)
			doSendMagicEffect(gdzieTP, 2)
		else
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Nie masz odpowiedniego storage. Ustaw sobie na 22 i wtedy sprawdz.")
		end
	end
return true
end

#edit
Teraz spr?buj.
 
Last edited:

drozd001

Advanced User
Joined
Dec 28, 2008
Messages
209
Reaction score
17
Odp: Skrypt pomocy

Wszystko napisa?em tak jak tu jest u ciebie. Ale problem jest w tym, ?e skrypt jakby w og?le nie znajduje kodu. Nic si? nie dzieje.

@edit To samo :/ Sorry, ?e odpisane dopiero teraz. Wcze?niej nie widzia?em twojego editu.
 
Last edited:
Status
Not open for further replies.
Top