What's new

Skrypty & Kody arena part2, lel.

Status
Not open for further replies.

#NOOB

Senior User
Joined
May 25, 2014
Messages
901
Reaction score
89
Tamten temat niepotrzebnie zg?asza?em do zamkni?cia, bo skrypt okaza? si? klap? :D No ale nie b?d? dupy zielonym tru? ?eby otworzyli wi?c zrobi? nowy.
buh.png
Teraz tak: Posta? GOD Tryller wchodzi na aren? (lewa cz??? zdj?cia), jest wszystko okej, je?li jakie? potwory s? na arenie to je kasuje, tworzy nowe na pozycjach podanych w skrypcie. I niby wszystko okej ale je?li postaci? Tiger Bonzo (prawa cz??? zdj?cia) u?yj? d?wigni gdy posta? GOD Tryller walczy na arenie to usuwa potwory zaznaczone na czerwono na lewej cz??ci zdj?cia i wywala komunikat, ?e kto? jest na arenie. Tylko jakim cudem ja si? pytam skoro powinno tylko komunikat wywali?? ;>

Skrypt:
[LUA]function onUse(cid, item, fromPosition, itemEx, toPosition)

local player = {x=1028,y=1190,z=9}
local target = {x=1029,y=1190,z=9}
local zombie1 = {x=1025,y=1188,z=9}
local zombie2 = {x=1025,y=1191,z=9}
local zombie3 = {x=1036,y=1188,z=9}
local zombie4 = {x=1036,y=1191,z=9}

if item.uid == 1004 then
for arenax = 1024, 1037 do
for arenay = 1186, 1194 do
local arenaPosition = {x=arenax, y=arenay, z=9, stackpos=255}
local arenaCreature = getThingfromPos(arenaPosition)

if(arenaCreature.itemid > 0 and isPlayer(arenaCreature.uid) == FALSE) then
if(isCreature(arenaCreature.uid) == TRUE) then
doRemoveCreature(arenaCreature.uid)
end
elseif(arenaCreature.itemid > 0 and isPlayer(arenaCreature.uid) == TRUE) then
doPlayerSendCancel(cid, "Aktualnie ktos wykonuje ta misje.")
return TRUE
end
end
end

doPlayerSendCancel(cid, "FIGHT!")
doTeleportThing(cid,player)
doSummonCreature("Troll",target)
doSummonCreature("Ghoul",zombie1)
doSummonCreature("Ghoul",zombie2)
doSummonCreature("Ghoul",zombie3)
doSummonCreature("Ghoul",zombie4)
end
end[/LUA]

Kto?, co?, gdzie?? ;/
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: arena part2, lel.

Przer?b sobie wedle w?asnego uznania.
PHP:
local centerPos = {x=1029,y=1190,z=9}
local rangex = 7
local rangey = 3
local playerPos = {x=1028,y=1190,z=9}

local monsterPositions = {	{pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
							{pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
							{pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
							{pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
							{pos = {x=1025,y=1188,z=9}, name = 'Troll'}}

local function createMonsters()
	for _, pid in pairs(monsterPositions) do
		doSummonCreature(pid.name, pid.pos)
	end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local spectators = getSpectators(centerPos, rangex, rangey)
if not spectators then
	createMonsters()
end
for _, pid in pairs(spectators) do
	if isPlayer(pid) then
		return doPlayerSendCancel(cid, "Aktualnie ktos wykonuje ta misje.")
	end
end
for _, pid in pairs(spectators) do
	if isMonster(pid) then
		doRemoveCrature(pid)
	end
end
createMonsters()
doPlayerSendCancel(cid, "FIGHT!")
doTeleportThing(cid, playerPos)
return false
end
 

#NOOB

Senior User
Joined
May 25, 2014
Messages
901
Reaction score
89
Odp: arena part2, lel.

834_b_d.png

Wypluwa taki b??d.

---------- Tre?? dodana o 17:42 ----------

Kto? ogarnie? :)
 

fabian766

Active User
Joined
Apr 15, 2008
Messages
126
Reaction score
17
Odp: arena part2, lel.

[LUA]local centerPos = {x=1029,y=1190,z=9}
local rangex = 7
local rangey = 3
local playerPos = {x=1028,y=1190,z=9}

local monsterPositions = { {pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
{pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
{pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
{pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
{pos = {x=1025,y=1188,z=9}, name = 'Troll'}}

local function createMonsters()
for _, pid in pairs(monsterPositions) do
doSummonCreature(pid.name, pid.pos)
end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local spectators = getSpectators(centerPos, rangex, rangey, FALSE)
if(not spectators) then
createMonsters()
end

for _, pid in pairs(spectators) do
if(isPlayer(pid)) then
return doPlayerSendCancel(cid, "Aktualnie ktos wykonuje ta misje.")
end
end

for _, pid in pairs(spectators) do
if(isCreature(pid) and not isPlayer(pid)) then
doRemoveCrature(pid)
end
end

createMonsters()
doPlayerSendCancel(cid, "FIGHT!")
doTeleportThing(cid, playerPos)
return false
end[/LUA]
spr?buj tak
 

#NOOB

Senior User
Joined
May 25, 2014
Messages
901
Reaction score
89
Odp: arena part2, lel.

B??d:
xdxdddddd.png



compat.lua, getSpectators:
[LUA]function getSpectators(centerPos, rangex, rangey, multifloor, onlyPlayers)
local result = getSpectators(centerPos, multifloor, onlyPlayers or false, rangex, rangex, rangey, rangey)
if #result == 0 then
return nil
end

for index, spectator in ipairs(result) do
result[index] = spectator:getId()
end
return result
end[/LUA]

---------- Tre?? dodana o 19:07 ----------

DOBRA TEN B??D BY? Z MOJEJ G?UPOTY :p
Teraz b??d jest taki, ?e jak poci?gn? za d?wigni? to tworzy potwory ale gracza nie teleportuje i je?li znowu poci?gn? za d?wigni? to wywala komunikat "Aktualnie ktos wykonuje ta misje." mimo, ?e gracza na arenie nie ma, bo go nie teleportowa?o.
Pluje przy tym b??dem (wcze?niej go nie zauwa?y?em, ah ta ?lepota)
hehehehahaha.png


---------- Tre?? dodana o 22:12 ----------

Pom??cie :D

---------- Tre?? dodana o 22:28 ----------

:crying:

---------- Tre?? dodana o 01:49 ----------

Ma kto? jaki? pomys?? ;>

---------- Tre?? dodana o 10:48 ----------

F5.
 
Last edited:

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: arena part2, lel.

PHP:
local centerPos = {x=1029,y=1190,z=9}
local rangex = 7
local rangey = 3
local playerPos = {x=1028,y=1190,z=9}
 
local monsterPositions = {	{pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
							{pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
							{pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
							{pos = {x=1025,y=1188,z=9}, name = 'Ghoul'},
							{pos = {x=1025,y=1188,z=9}, name = 'Troll'}}
 
local function createMonsters()
	for _, pid in pairs(monsterPositions) do
		doSummonCreature(pid.name, pid.pos)
	end
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local spectators = getSpectators(centerPos, rangex, rangey)
if not spectators then
	createMonsters()
end
if spectators then
	for _, pid in pairs(spectators) do
		if isPlayer(pid) then
			return doPlayerSendCancel(cid, "Aktualnie ktos wykonuje ta misje.")
		end
	end
	for _, pid in pairs(spectators) do
		if isMonster(pid) then
			doRemoveCrature(pid)
		end
	end
end
createMonsters()
doPlayerSendCancel(cid, "FIGHT!")
doTeleportThing(cid, playerPos)
return false
end
 

#NOOB

Senior User
Joined
May 25, 2014
Messages
901
Reaction score
89
Odp: arena part2, lel.

Oskar, tw?j skrypt dalej nie dzia?a ;/
Aktualnie mam taki skrypt, kt?ry o dziwo hula tak jak chc?. Je?li kto? b?dzie chcia?:
[LUA]local config = {
player = {x=1028,y=1190,z=9},
player1 = {x=1029,y=1190,z=9},
player2 = {x=1025,y=1188,z=9},
player3 = {x=1025,y=1192,z=9},
player4 = {x=1036,y=1188,z=9},
player5 = {x=1036,y=1192,z=9},
level = 120,
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid == 1005 then

if (getPlayerLevel(cid) > config.level-1) then
for arenax = 1027, 1034 do
for arenay = 1187, 1193 do

local arenaPosition = {x=arenax, y=arenay, z=9, stackpos = STACKPOS_TOP_CREATURE}
local arenaCreature = getThingfromPos(arenaPosition)

if(arenaCreature.itemid > 0 and isPlayer(arenaCreature.uid) == TRUE) then
doPlayerSendTextMessage(cid,22,"Aktualnie ktos wykonuje to zadanie.")
return TRUE
end
end
end

for arena2x = 1025, 1036 do
for arena2y = 1187, 1193 do

local arena2Position = {x=arena2x, y=arena2y, z=9, stackpos=253}
local arena2Creature = getThingfromPos(arena2Position)

for i = 1,5 do

if(arena2Creature.itemid > 0 and isPlayer(arena2Creature.uid) == FALSE) then
doRemoveCreature(arena2Creature.uid)
break

end
end
end
end

doPlayerSendTextMessage(cid,22,"Walcz!")
doTeleportThing(cid,config.player)
doSummonCreature("Troll",config.player1)
doSummonCreature("Ghoul",config.player2)
doSummonCreature("Ghoul",config.player3)
doSummonCreature("Ghoul",config.player4)
doSummonCreature("Ghoul",config.player5)
return TRUE
else
doPlayerSendTextMessage(cid,22,"Wymagany" .. config.level .. " aby wykonac to zadanie.")
end
end
return FALSE
end[/LUA]
M?g?by? jeszcze rzuci? na niego okiem i poskraca? to co si? da do niezb?dnego minimum? :) Bo skrypt jest zapewne bardzo chujowy jako?ciowo i pewnie mo?na tam jeszcze co? poskraca?.
 
Status
Not open for further replies.
Top