• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

modify a easy script

XLeoX

New Member
Joined
Jun 12, 2011
Messages
5
Reaction score
0
good night guys, I come to you today asking for a modification to a script, I would like this script, buy potion, was modified to be used only on pz. Thanks in advance.
Code:
function onSay(cid, words, param)

if doPlayerRemoveMoney(cid, 15000) == TRUE then
local bp = doPlayerAddItem(cid, 8473, 100)
doSendMagicEffect(getCreaturePosition(cid),13)
(getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doCreatureSay(cid, "You just bought a Potion!", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "You do not have enough money!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
 
Code:
local cost = 15000 -- how much money
local item = 8473 -- item id
local amount = 100 -- how many 
function onSay(cid, words, param, channel)
	if(getTilePzInfo(getCreaturePosition(cid))) then
		if doPlayerRemoveMoney(cid, cost) then
			doPlayerAddItem(cid, item, amount)
			doCreatureSay(cid, "You just bought a Potion!", TALKTYPE_ORANGE_1)
	else
			doCreatureSay(cid, "You do not have enough money!", TALKTYPE_ORANGE_1)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
			end
	else
			doCreatureSay(cid, "you have to be in protection zone to use this command", TALKTYPE_ORANGE_1)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
			end
		return true
	end
 
Back
Top