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

Outfits

I r New

New Member
Joined
Feb 1, 2008
Messages
137
Reaction score
1
I am trying to make a outfits command for normal playes and it cost 500K to buy the outfit.

I have dis so far.
PHP:
function onSay(cid, words, param)
	if doPlayerRemoveMoney(cid, 500000) == 1 then
		doPlayerSendTextMessage(cid, 21, "You have bought this outfit.")
		else
		doPlayerSendTextMessage(cid, 21, "You do not have 500k to buy a outfit.")
	end

	local t = string.explode(param, ",")
	t[1] = tonumber(t[1])
	if(not t[1]) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
		return TRUE
	end

	if(t[2]) then
		cid = getPlayerByNameWildcard(t[2])
		if(cid == 0 or (isPlayerGhost(pid) == TRUE and getPlayerAccess(pid) > getPlayerAccess(cid))) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
			return TRUE
		end
	end

	if(t[1] < 0 or t[1] == 1 or t[1] == 135 or (t[1] > 160 and t[1] < 192) or t[1] > 326) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such outfit does not exist.")
		return TRUE
	end

	local tmp = getCreatureOutfit(cid)
	tmp.lookType = t[1]
	doCreatureChangeOutfit(cid, tmp)
	return TRUE
end

The problem is.

When you dont have moneys it still works.
 
After

doPlayerSendTextMessage(cid, 21, "You do not have 500k to buy a outfit.")

add

return TRUE

so script will not execute bottom code
 
Back
Top Bottom