• 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!

help with script please

Status
Not open for further replies.

p41nwithoutlove

New Member
Joined
Aug 12, 2008
Messages
216
Reaction score
0
ok im using this script from my old tfs .2.4

PHP:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 5000) == 1 then
doPlayerAddItem(cid, 2306, 10)
else
			doPlayerSendCancel(cid, 'You don\'t have enough money.')
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		end
		end

basically what happens is when u say the word it takes the 5k from u but it doesnt give u the item and it says you dont have enough money

im pretty sure its because its a tfs .2.4 script can any 1 help?
rep++ ofc for help
 
Lua:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 5000) == true then
doPlayerAddItem(cid, 2306, 10)
else
            doPlayerSendCancel(cid, 'You don\'t have enough money.')
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        end
 end
 
0.2.5 - Not Tested

Script.lua
Lua:
local items =
{
	["aol"] = {id = 2173, cost = 10000},
	["backpack"] = {id = 1988, cost = 10}
}

function onSay(cid, words, param)
	if (param == "") then
	    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This is not valid.")
	return TRUE
	end
	if doPlayerRemoveMoney(cid, items[param].cost) == TRUE then 
	    doPlayerAddItem(cid, items[param].id, 1) 
	else 
	    doPlayerSendCancel(cid, "You don\'t have enough money.") 
	    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	end
	return TRUE
end

Example:
  • !buy aol
  • !buy backpack
 
Status
Not open for further replies.
Back
Top