What's new

Skrypty & Kody Przer?bka skryptu na bp potion

Status
Not open for further replies.

Gizmoo

Advanced User
Joined
Jan 9, 2011
Messages
243
Reaction score
2
witam mam tutaj taki skrypt i mam pytanie czy mozna zrobic aby kupywac backpack ,backpack?w tych potionek ?

local Cost = 2000
local RuneId = 7591
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, Cost) == 1 then
backpack = doPlayerAddItem(cid, 2000, 1)
for i = 1, 20 do
doAddContainerItem(backpack, RuneId, 1)
doPlayerSendTextMessage(cid,22,"Kupiles- 20 Great Health Potion .")
doSendMagicEffect(getPlayerPosition(cid), CONST_ANI_ENERGYBALL)
end
else
doPlayerSendTextMessage(cid,22, '20 Great Health Potion kosztuje 2000 GP .')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_DRAWBLOOD)
end
return 1
end
 

fabian766

Active User
Joined
Apr 15, 2008
Messages
126
Reaction score
17
Odp: Przer?bka skryptu na bp potion

[LUA]local Cost = 2000
local RuneId = 7591

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(doPlayerRemoveMoney(cid, Cost)) then
backpack = doPlayerAddItem(cid, 2000, 1)
for i = 1, 20 do
backpack2 = doCreateItemEx(2000, 1)
for j = 1, 20 do
doAddContainerItem(backpack2, RuneId, 1)
end

doAddContainerItemEx(backpack, backpack2)
end

doPlayerSendTextMessage(cid, 22, "Kupiles - 400 Great Health Potion .")
doSendMagicEffect(getPlayerPosition(cid), CONST_ANI_ENERGYBALL)
else
doPlayerSendTextMessage(cid, 22, "400 Great Health Potion kosztuje " .. Cost .. " GP .")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_DRAWBLOOD)
end

return true
end[/LUA]
 

Gizmoo

Advanced User
Joined
Jan 9, 2011
Messages
243
Reaction score
2
Odp: Przer?bka skryptu na bp potion

[LUA]/bpbpmana.lua:13: attempt to call global 'doAddContainerItemEx' (a nil value)[/LUA]

wyskakuje mi taki b??d ;x
 

Oskar1415

Advanced User
Joined
Feb 25, 2009
Messages
381
Reaction score
22
Odp: Przer?bka skryptu na bp potion

local Cost = 2000
local RuneId = 7591

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(doPlayerRemoveMoney(cid, Cost)) then
local backpack = doPlayerAddItem(cid, 2000, 1)
for i = 1, 20 do
local backpack2 = doCreateItemEx(2000, 1)
for j = 1, 20 do
doAddContainerItem(backpack2, RuneId, 1)
end

doAddContainerItemEx(backpack, backpack2)
end

doPlayerSendTextMessage(cid, 22, "Kupiles - 400 Great Health Potion .")
doSendMagicEffect(getPlayerPosition(cid), CONST_ANI_ENERGYBALL)
else
doPlayerSendTextMessage(cid, 22, "400 Great Health Potion kosztuje " .. Cost .. " GP .")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_DRAWBLOOD)
end

return true
end
Spr?buj tego nie testowa?em
 

fabian766

Active User
Joined
Apr 15, 2008
Messages
126
Reaction score
17
Odp: Przer?bka skryptu na bp potion

[LUA]local Cost = 2000
local RuneId = 7591

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(doPlayerRemoveMoney(cid, Cost)) then
local backpack = doPlayerAddItem(cid, 2000, 1)
for i = 1, 20 do
backpack2 = doAddContainerItem(backpack, 2000, 1)
for j = 1, 20 do
doAddContainerItem(backpack2, RuneId, 1)
end
end

doPlayerSendTextMessage(cid, 22, "Kupiles - 400 Great Health Potion .")
doSendMagicEffect(getPlayerPosition(cid), CONST_ANI_ENERGYBALL)
else
doPlayerSendTextMessage(cid, 22, "400 Great Health Potion kosztuje " .. Cost .. " GP .")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_DRAWBLOOD)
end

return true
end[/LUA]
 

Gizmoo

Advanced User
Joined
Jan 9, 2011
Messages
243
Reaction score
2
Odp: Przer?bka skryptu na bp potion

dobra dzia?a ,dzi?kuj? bardzo a mo?a doda? ograniczenie ,?e jak gracz nie ma CAP to nie kupi i wy?wietli si? komunikat ?
 

fabian766

Active User
Joined
Apr 15, 2008
Messages
126
Reaction score
17
Odp: Przer?bka skryptu na bp potion

[LUA]local Cost = 2000
local RuneId = 7591

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerMoney(cid) >= Cost) then
local backpack = doCreateItemEx(2000, 1)
for i = 1, 20 do
backpack2 = doAddContainerItem(backpack, 2000, 1)
for j = 1, 20 do
doAddContainerItem(backpack2, RuneId, 1)
end
end

if(doPlayerAddItemEx(cid, backpack, false) ~= RETURNVALUE_NOERROR) then
doPlayerSendTextMessage(cid, 22, "400 Great Health Potion jest zbyt ciezkie albo nie masz miejsca w ekwipunku .")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_DRAWBLOOD)
else
doPlayerRemoveMoney(cid, Cost)
doPlayerSendTextMessage(cid, 22, "Kupiles - 400 Great Health Potion .")
doSendMagicEffect(getPlayerPosition(cid), CONST_ANI_ENERGYBALL)
end
else
doPlayerSendTextMessage(cid, 22, "400 Great Health Potion kosztuje " .. Cost .. " GP .")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_DRAWBLOOD)
end

return true
end[/LUA]
 

Gizmoo

Advanced User
Joined
Jan 9, 2011
Messages
243
Reaction score
2
Odp: Przer?bka skryptu na bp potion

kupywac nie kupuje ale pobiera pieni?dze :D
 

fabian766

Active User
Joined
Apr 15, 2008
Messages
126
Reaction score
17
Odp: Przer?bka skryptu na bp potion

jaki dok?adnie silnik? i masz jakie? b??dy w konsoli?
 

Gizmoo

Advanced User
Joined
Jan 9, 2011
Messages
243
Reaction score
2
Odp: Przer?bka skryptu na bp potion

nie mam b??du tylko pobiera kase nawet jak nie kupie
 
Status
Not open for further replies.
Top