What's new

skrypt problem

Status
Not open for further replies.

Elvascoo

Active User
Joined
Nov 2, 2010
Messages
59
Reaction score
0
witam mam skrypt ktory po nacisnieciu na dzwignie da bp sd lecz nie dziala zabiera kase a nie dahe sd co jest zle?
local Cost = 10000
local RuneId = 2268
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, Cost) == 1 then
backpack = doPlayerAddItem(cid, 2003, 1)
for i = 1, 20 do
doAddContainerItem(backpack, RuneId, 35)
end
else
doPlayerSendCancel(cid, 'You don\'t have enough money.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return 1
end
 

ErMex

Egzekucja
Joined
Dec 1, 2010
Messages
574
Reaction score
181
Odp: skrypt problem

U?yj tego:
PHP:
        sd_id = 2268 -- Item a ser vendido
        backpacksd_id = 2003 -- Backpack
		custosd_id = 6000 -- Valor
		cargassd_id = 25 -- Cargas

local name = getItemNameById(sd_id)
----- End Config -----
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if doPlayerRemoveMoney(cid, custosd_id) == TRUE then
                local bag = doPlayerAddItem(cid, backpacksd_id, 1)
                        doSendAnimatedText(fromPosition, "Purchased", TEXTCOLOR_YELLOW)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custosd_id .." gold.")
						for i=1,20 do
                        doAddContainerItem(bag, sd_id, cargassd_id)
                end
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custosd_id .." gold coins for a backpack of ".. name .."s.")
                end
        return FALSE
end

Pozdrawiam,
ErMex
 

Elvascoo

Active User
Joined
Nov 2, 2010
Messages
59
Reaction score
0
Odp: skrypt problem

fire bomb rune
sd_id = 2305 -- Item a ser vendido
backpacksd_id = 2000 -- Backpack
custosd_id = 10000 -- Valor
cargassd_id = 6 -- Cargas

local name = getItemNameById(sd_id)
----- End Config -----
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, custosd_id) == TRUE then
local bag = doPlayerAddItem(cid, backpacksd_id, 1)
doSendAnimatedText(fromPosition, "Purchased", TEXTCOLOR_YELLOW)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custosd_id .." gold.")
for i=1,20 do
doAddContainerItem(bag, sd_id, cargassd_id)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custosd_id .." gold coins for a backpack of ".. name .."s.")
end
return FALSE
end
magic wall rune
sd_id = 2293 -- Item a ser vendido
backpacksd_id = 2004 -- Backpack
custosd_id = 10000 -- Valor
cargassd_id = 6 -- Cargas

local name = getItemNameById(sd_id)
----- End Config -----
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, custosd_id) == TRUE then
local bag = doPlayerAddItem(cid, backpacksd_id, 1)
doSendAnimatedText(fromPosition, "Purchased", TEXTCOLOR_YELLOW)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custosd_id .." gold.")
for i=1,20 do
doAddContainerItem(bag, sd_id, cargassd_id)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custosd_id .." gold coins for a backpack of ".. name .."s.")
end
return FALSE
end
sudden death rune
sd_id = 2268 -- Item a ser vendido
backpacksd_id = 2003 -- Backpack
custosd_id = 10000 -- Valor
cargassd_id = 45 -- Cargas

local name = getItemNameById(sd_id)
----- End Config -----
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, custosd_id) == TRUE then
local bag = doPlayerAddItem(cid, backpacksd_id, 1)
doSendAnimatedText(fromPosition, "Purchased", TEXTCOLOR_YELLOW)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custosd_id .." gold.")
for i=1,20 do
doAddContainerItem(bag, sd_id, cargassd_id)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custosd_id .." gold coins for a backpack of ".. name .."s.")
end
return FALSE
end
paralyze rune
sd_id = 2278 -- Item a ser vendido
backpacksd_id = 5949 -- Backpack
custosd_id = 12000 -- Valor
cargassd_id = 9 -- Cargas

local name = getItemNameById(sd_id)
----- End Config -----
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, custosd_id) == TRUE then
local bag = doPlayerAddItem(cid, backpacksd_id, 1)
doSendAnimatedText(fromPosition, "Purchased", TEXTCOLOR_YELLOW)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custosd_id .." gold.")
for i=1,20 do
doAddContainerItem(bag, sd_id, cargassd_id)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custosd_id .." gold coins for a backpack of ".. name .."s.")
end
return FALSE
end
Mam te 4 skrypty kazdy pod inna dziwgnie dlaczego po nacisnieciu kazdej z 4 dzwigni dostaje tylko fire bomb rune zamiast mw itd np naciskam 1 dzwignie daje sd 2 mw a tak nie jest tylko naciskam kazda po koleji to przy kazdej dostaje firebomb rune co jest nie tak?
You have purchased a backpack of paralyze runes for 10000 gold.
a dalo fire bomb runy
 
Last edited:
Status
Not open for further replies.
Top