• 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!

lua - mała poprawka

dima0909

Banned User
Joined
Oct 18, 2012
Messages
271
Reaction score
0
Witam.
Usiłowałem dodać do istniejącego skryptu kolejny element ale coś mi nie poszło ;/

Skrypt ma cofać na poprzednią pozycję x,y,z gdy nie ma się odpowiedniego lvl:

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPlayer(cid)) then
return true
end
if(getPlayerLevel(cid) < 1000 and item.actionid == 5020) then
doTeleportThing(cid, lastPosition)
doPlayerSay(cid,'Quest jest od 1000 lvl !',TALKTYPE_ORANGE_1)
end

elseif(getPlayerLevel(cid) < 900 and item.actionid == 5021) then
doTeleportThing(cid, lastPosition)
doPlayerSay(cid,'Quest jest od 900 lvl !',TALKTYPE_ORANGE_1)

end


return true
end
to co zaznaczyłem na czerwono, dodałem sam...
lecz stale mi wywala jakiś błąd w tej linijce elseif...co zrobiłem źle ?
 
no ok zrobię tak, ale nie rozumiem dlaczego kod działa normalnie...a jak chce dodać mu kolejny warunek...na inny lvl i action id....to przestaje działać....
coś nie dodałem ? jakiegoś znaczka czy cuś ? (w tej funkcji elseif)

@edit

z kolei jak wywale jedno end ... to nie wywala błędu ale też ta druga funkcja (moja) nie działa

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPlayer(cid)) then
return true
end
if(getPlayerLevel(cid) < 1000 and item.actionid == 5020) then
doTeleportThing(cid, lastPosition)
doPlayerSay(cid,'Quest jest od 1000 lvl !',TALKTYPE_ORANGE_1)

elseif(getPlayerLevel(cid) < 900 and item.actionid == 5021) then
doTeleportThing(cid, lastPosition)
doPlayerSay(cid,'Quest jest od 900 lvl !',TALKTYPE_ORANGE_1)



end
return true
end
 
Last edited:
lastPosition < --- co to kurwa jest? p;ewnie ma działać tak samo jak fromPosition

wywal lastPosition i używaj fromPosition >.<
i naucz się tabowac tekst kurwa <=-= wtedy byś widział ghdzie błąd

Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(not isPlayer(cid)) then
		return true
	end
	if(getPlayerLevel(cid) < 1000 and item.actionid == 5020) then
		doTeleportThing(cid, lastPosition)
		doPlayerSay(cid,'Quest jest od 1000 lvl !',TALKTYPE_ORANGE_1)
	end

	elseif(getPlayerLevel(cid) < 900 and item.actionid == 5021) then
		doTeleportThing(cid, lastPosition)
		doPlayerSay(cid,'Quest jest od 900 lvl !',TALKTYPE_ORANGE_1)

end

return true
end


elseif do czego? jak nie ma wczesniej if'a lol, musi być if musku
 
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(not isPlayer(cid)) then
		return true
	end
	
	if(getPlayerLevel(cid) < 1000 and item.actionid == 5020) then
		doTeleportThing(cid, lastPosition)
		doPlayerSay(cid,'Quest jest od 1000 lvl !',TALKTYPE_ORANGE_1)
	elseif(getPlayerLevel(cid) < 900 and item.actionid == 5021) then
		doTeleportThing(cid, fromPosition)
		doPlayerSay(cid,'Quest jest od 900 lvl !',TALKTYPE_ORANGE_1)
	end

	return true
end

nie zamykasz if jeśli chcesz użyć elseif
 
lastPosition < --- co to kurwa jest? p;ewnie ma działać tak samo jak fromPosition

wywal lastPosition i używaj fromPosition >.<
i naucz się tabowac tekst kurwa <=-= wtedy byś widział ghdzie błąd

Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(not isPlayer(cid)) then
		return true
	end
	if(getPlayerLevel(cid) < 1000 and item.actionid == 5020) then
		doTeleportThing(cid, lastPosition)
		doPlayerSay(cid,'Quest jest od 1000 lvl !',TALKTYPE_ORANGE_1)
	end

	elseif(getPlayerLevel(cid) < 900 and item.actionid == 5021) then
		doTeleportThing(cid, lastPosition)
		doPlayerSay(cid,'Quest jest od 900 lvl !',TALKTYPE_ORANGE_1)

end

return true
end


elseif do czego? jak nie ma wczesniej if'a lol, musi być if musku

Noob, nie zadziała, masz poprawioną wersje :)

Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

	if(not isPlayer(cid)) then
		return true
	end
	
	if(getPlayerLevel(cid) < 1000 and item.actionid == 5020) then
		doTeleportThing(cid, fromPosition)
		doPlayerSay(cid,'Quest jest od 1000 lvl !',TALKTYPE_ORANGE_1)
	
 
	elseif(getPlayerLevel(cid) < 900 and item.actionid == 5021) then
		doTeleportThing(cid, fromPosition)
		doPlayerSay(cid,'Quest jest od 900 lvl !',TALKTYPE_ORANGE_1)
	end
		
return true
end
 
@edit
Potar...to samo napisalem co Ty i nic ;> pierwsze działa = drugie nie

no dodałem fromPosition :) a efekt ten sam.... pierwsza funkcja dziala - druga nie (nawet błędu w konsoli niema żadnego):
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPlayer(cid)) then
 return true
end
if(getPlayerLevel(cid) < 1000 and item.actionid == 5020) then
 doTeleportThing(cid, fromPosition)
 doPlayerSay(cid,'Quest jest od 1000 lvl !',TALKTYPE_ORANGE_1)

 elseif(getPlayerLevel(cid) < 900 and item.actionid == 5021) then
    doTeleportThing(cid, fromPosition)
    doPlayerSay(cid,'Quest jest od 900 lvl !',TALKTYPE_ORANGE_1)
   

end
return true
end
 
@edit
Potar...to samo napisalem co Ty i nic ;> pierwsze działa = drugie nie

no dodałem fromPosition :) a efekt ten sam.... pierwsza funkcja dziala - druga nie (nawet błędu w konsoli niema żadnego):
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPlayer(cid)) then
 return true
end
if(getPlayerLevel(cid) < 1000 and item.actionid == 5020) then
 doTeleportThing(cid, fromPosition)
 doPlayerSay(cid,'Quest jest od 1000 lvl !',TALKTYPE_ORANGE_1)

 elseif(getPlayerLevel(cid) < 900 and item.actionid == 5021) then
    doTeleportThing(cid, fromPosition)
    doPlayerSay(cid,'Quest jest od 900 lvl !',TALKTYPE_ORANGE_1)
   

end
return true
end

a Zauważyłeś, że w pierwszym przyp[adku jest actionid 5020, a w drugim 5021? -.-

i wyjeb to lastPosition z onStepIn bo po chuj ono tam jak jest fromPosition ?;s
 
nie wiem jak to wygląda z innymi tile'ami, ale na drzwi chyba ustawiało się wymóg level'owy w ten sposób, że przypisywało się do nich AID = wymagany lvl + 1000 ;)
 
Back
Top