What's new

Actions Random Present Bag (Vestia.pl)

Status
Not open for further replies.

DanJ93

ElfBot Helper
Joined
Jan 18, 2009
Messages
2,631
Reaction score
200
Odp: Random Present Bag (Vestia.pl)

#UP
Dok?adnie, to by?o pisane na szybko :p

---------- Tre?? dodana o 14:21 ----------

DanJ93 przy twoim mam b?ad(linia: if RandomPresent[Random] == 2160 then), fajny skrypt, napewno si? przyda :D Da?o by rade doda? do skryptu: ?e dana profesja ma wieksze szanse na zdobycie danego przedmiotu?
Poprawi?em.
Nie testowane, ale powinno by?:
[lua]local RandomPresent = {8925, 5907, 6433, 9776, 9932, 9777, 2160}
local k = {
[1] = {90},
[2] = {90},
[3] = {80},
[4] = {60}
}
local c = getPlayerVocation(cid)
function onUse(cid, item, frompos, item2, topos)
local Random = math.random(#RandomPresent)
if c = k[c] then
if math.random(100) <= k[c][1] then
if RandomPresent[Random] == 2160 then
local ilosc = 50
else
local ilosc = 1
end
if doPlayerAddItem(cid, RandomPresent[Random], ilosc, false) then
doPlayerSendTextMessage(cid,22,"Otrzyma?e? "..getItemNameById(RandomPresent[Random])..". Gratuluje.")
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid,22,"Potrzebujesz wi?cej capa/miejsca.")
end
else
doPlayerSendTextMessage(cid,22,"Masz pecha...")
end
else
doPlayerSendTextMessage(cid,22,"Nie masz odpowiedniej profesji.")
end
return true
end[/lua]
 

mial123

Advanced User
Joined
Apr 2, 2009
Messages
307
Reaction score
24
Odp: Random Present Bag (Vestia.pl)

DanJ93 a to jest do wszystkich tak? a da?bo by rade ?e do poszczeg?lne profesje maja wieksze szanse zdobycia itemku o id, takim i takim?
 

Arkam

Forum friend
Joined
Dec 20, 2008
Messages
1,980
Reaction score
180
Odp: Random Present Bag (Vestia.pl)

[lua]if c = k[c] then[/lua]
yyy wtf? :p jak ju? to nie 1 znak r?wno?ci tylko 2, a pozatym to nie tak tylko isInArray chyba :D

#UP To mo?e sam sobie zr?b... ci??ko przeczyta? 1-2 poradniki o lua, tablicach, p?tlach?
 

DanJ93

ElfBot Helper
Joined
Jan 18, 2009
Messages
2,631
Reaction score
200
Odp: Random Present Bag (Vestia.pl)

DanJ93 a to jest do wszystkich tak? a da?bo by rade ?e do poszczeg?lne profesje maja wieksze szanse zdobycia itemku o id, takim i takim?
No przecie? tak jest, o ile dzia?a :D
 
Status
Not open for further replies.
Top