• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

On Advance

GarQet

Own3d!
Joined
Feb 10, 2009
Messages
1,381
Solutions
14
Reaction score
81
Chodzi mi o pewną rzecz, dopiero się uczę skryptować i coś kombinuje, lecz tym razem mi coś nie wyszło :(.
Chciałem stworzyć skrypt, że jeżeli gracz wbije 50 level to dostaje nagrodę w postaci pieniężnej oraz dostaje storage value aby nie oszukać skryptu (spaść na 49 i wbić 50 poraz drugi, przy czym otrzymać nagrodę).
Lecz skrypt nie działa, gdy gracz wbija 50level nic się nie dzieje, błędów nie ma.
Oto skrypt:
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
local storage = getPlayerStorageValue(cid, 9918)
if(storage == 1) then
return true
end

if (skill == SKILL_LEVEL and newlevel == 50) then
           doPlayerAddItem(cid,2160,5)
  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
           doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Congratulation for 50 level, have a nice game!')
setPlayerStorageValue(cid, 9918, 1)
end
return true
end
To .xml:
Code:
      <event type="advance" name="Adv" event="script" value="Oo.lua"/>
A to w login.lua:
Code:
        registerCreatureEvent(cid, "Adv")

Ma ktoś może pomysł co może być źle? :(
Proszę o pomoc. Dam reputa.
Pozdrawiam GarQet.
 
Last edited:
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
	if(skill == SKILL_LEVEL and newLevel >= 50 and getPlayerStorageValue(cid, 9918) < 1) then
		doPlayerAddItem(cid, 2160, 5)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulation for 50 level, have a nice game")
		setPlayerStorageValue(cid, 9918, 1)
	end
	return true
end
 
vDk a mam pytanko czy potrafisz może zrobić tak, żeby zmieniło looktype gracza na looktype danego monstera na 60 sekund? Bo ja próbowałem tak zrobić, ale nie potrafię wprowadzić czasu :(. Pomógłbyś? :)
 
No a time podaje w sekundach czy jak?

Bo ja bym chciał looktype ghazbarana tylko dany jego kolor :p.
 
Hmmm... Ten skrypt w ogóle nie działa, znów nie ma błędu.
Ja mam silnik 0.3.5pl1
 
LUA:
  function onAdvance(cid, skill, oldLevel, newLevel)
        if(skill == 8 and newLevel >= 50 and getPlayerStorageValue(cid, 9918) < 1) then
                doPlayerAddItem(cid, 2160, 5)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulation for 50 level, have a nice game")
                setPlayerStorageValue(cid, 9918, 1)
        end
        return true
end
a takie coś?; d
 
No działa, dzięki za pomoc. A mógłbyś jeszcze wpasować to aby zmieniło graczowi looktype na 12 o danych kolorach na 30 sekund?
Będę wdzięczny :).
Reput leci.
 
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
	local outfit = {lookType = 128, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
	if(skill == 8 and newLevel >= 50 and getPlayerStorageValue(cid, 9918) < 1) then
                doSetCreatureOutfit(cid, outfit, 30) 
		doPlayerAddItem(cid, 2160, 5)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulation for 50 level, have a nice game")
		setPlayerStorageValue(cid, 9918, 1)
	end
	return true
end
 
Hmmm... Testowałem i zmieniło outfit na 1 sekunde? Albo i mnie, pokazało się i usunęło od razu.
 
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
        local outfit = {lookType = 128, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
        if(skill == 8 and newLevel >= 50 and getPlayerStorageValue(cid, 9918) < 1) then
                doSetCreatureOutfit(cid, outfit, 3 * 1000)
                doPlayerAddItem(cid, 2160, 5)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulation for 50 level, have a nice game, a teraz wypierdalaj z serwera szmato. :)")
                setPlayerStorageValue(cid, 9918, 1)
        end
        return true
end
 
Back
Top