• logo_cipsoft
    Nowe serwery zostały otwarte 19 Lut 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

Szukanie itema na mapie- zaawansowane

Loganasd

Advanced User
Dołączył
Styczeń 9, 2010
Posty
157
Liczba reakcji
0
Przerabiam silnik WoDBO, a jak wiadomo to server Dragon Ball. Co to za DB bez smoka? Smoka mam, kule mam, smok si? pojawia, tylko chcia?bym zrobi? radar, kt?ry umo?liwii nam szukanie tych kul (b?d? je raz na kilka dni rzuca? po mapie). W silniku jest ju? radar i jest ju? skrypt tylko, ?e nie dzia?a - wiem chyba dlaczego, ale nic nie m?wi?, ?eby Was z tropu nie zbija?. Zawsze jak si? kliknie na radar to pisze "Radar Cant find the Dragon Ball.". Oto skrypt:
function onUse(cid, item, frompos, item2, topos)

kula1 = {x=83, y=377, z=7, stackpos=1}

getpiece1 = getThingfromPos(kula1)


player = getPlayerPosition(cid)

if item.itemid == 2062 and getpiece1.itemid == 2625 then

if player.x > 700 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is on Earth.")
elseif player.z > kula1.z and (player.y - kula1.y) <= 3 and (player.y - kula1.y) > -3 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is above you.")
elseif player.z < kula1.z and (player.x - kula1.x) <= 3 and (player.x - kula1.x) > -3 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is below you.")
else
if player.x > kula1.x then
if player.y > kula1.y then
if (player.y - kula1.y) >= 3 then
if (player.x - kula1.x) >= 1 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-west.")
else
if (player.y - kula1.y) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
end
end
else
if (player.x - kula1.x) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
end
end
elseif player.y < kula1.y then
if (kula1.y - player.y) >= 3 then
if (kula1.x - player.x) >= 1 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south-west.")
else
if (kula1.y - player.y) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
end
end
else
if (player.x - kula1.x) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
end
end
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
end
elseif player.x < kula1.x then
if player.y > kula1.y then
if (player.y - kula1.y) >= 3 then
if (kula1.x - player.x) >= 1 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-east.")
else
if (player.y - kula1.y) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
end
end
else
if (kula1.x - player.x) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
end
end
elseif player.y < kula1.y then
if (kula1.y - player.y) >= 3 then
if (kula1.x - player.x) >= 1 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south-east.")
else
if (kula1.y - player.y) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
end
end
else
if (kula1.x - player.x) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
end
end
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
end
else
if player.y > kula1.y then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
end
end
end

else
doPlayerSendCancel(cid,"Radar Cant find the Dragon Ball.")
end
return 1
end
Za pomoc reput + podzi?kowanie (nie b?d?cie materialistami i pom??cie bez kasy:P).

#Edit
Pami?tajcie, ?e ja te kule chc? rozrzuca? po mapie, a nie respi? w konkretnych miejsach - my?l?, ?e trzeba b?dzie pisa? new skrypt i tylko elementy wzi?? z tego.

aaaaaa i autorem tego jest oczywi?cie WoDBO team, a nie ja
 
Odp: Szukanie itema na mapie- zaawansowane

czy wpisa?e? dobre po?o?enie kuli ?
kula1 = {x=83, y=377, z=7, stackpos=1}

albo czy kula 1 ma id takie jak tu ?
if item.itemid == 2062 and getpiece1.itemid == 2625 then
??
bo skrypt wygl?da na dobry. :) dopiero zaczynam bawi? si? w skrypty.
 
Odp: Szukanie itema na mapie- zaawansowane

wydawalo mi sie ze tak ale ja chce ten skrypt przerobic na taki ze bedzie szukalem 7 kul w nie stalych miejscach tylko tak jak je rozrzuce

czy sie rozno item.itemid od getpiece1.itemid?
 
Odp: Szukanie itema na mapie- zaawansowane

da sie tak zrobic zeby szukal itemu i wskazywal kierunek niezaleznie od jego polozenia?
 
Odp: Szukanie itema na mapie- zaawansowane

hmm zapewne chodzi ci o co? podobnego jak w DBL
lecz tam jest zrobione tak ?e jest na mapie kilka/kilkana?cie miejsc w kt?rych pojawia si? kula sa one wpisane do radaru.
 
Do góry