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

what i need?

qruczu

New Member
Joined
Jan 8, 2012
Messages
104
Reaction score
0
What do I need to add that after receiving the award could not have her for the second time to get?
sorry for translate ;c
function onSay(cid, words, param, channel)

if getPlayerSkill(cid, SKILL_CLUB) >= 50 then
doPlayerSendTextMessage(cid, 19,"Reward.")
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 100)
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 50)


elseif getPlayerSkill(cid, SKILL_CLUB) >= 100 then
doPlayerSendTextMessage(cid, 19,"Reward.")
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 200)
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 100)


elseif getPlayerSkill(cid, SKILL_CLUB) >= 150 then
doPlayerSendTextMessage(cid, 19,"Reward.")
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 300)
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 200)


elseif getPlayerSkill(cid, SKILL_CLUB) >= 200 then
doPlayerSendTextMessage(cid, 19,"Reward.")
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 500)
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 300)

else
doPlayerSendTextMessage(cid, 19,"You do not have enough club.")
end

return true
end

@down
thanks i add you reputation :)
 
Last edited:
The code is really badly written with all these elseifs and I don't have enough time to shorten the code but this should work

Lua:
function onSay(cid, words, param, channel)
	if getPlayerSkill(cid, SKILL_CLUB) >= 50 and getCreatureStorage(cid, 1337) < 1 then
		doCreatureSetStorage(cid, 1337, 1)
		doPlayerSendTextMessage(cid, 19,"Reward.")
		setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 100)
		setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 50)
	elseif getPlayerSkill(cid, SKILL_CLUB) >= 100 and getCreatureStorage(cid, 1337) < 2 then
		doCreatureSetStorage(cid, 1337, 2)
		doPlayerSendTextMessage(cid, 19,"Reward.")
		setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 200)
		setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 100)
	elseif getPlayerSkill(cid, SKILL_CLUB) >= 150 and getCreatureStorage(cid, 1337) < 3 then
		doCreatureSetStorage(cid, 1337, 3)
		doPlayerSendTextMessage(cid, 19,"Reward.")
		setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 300)
		setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 200)
	elseif getPlayerSkill(cid, SKILL_CLUB) >= 200 and getCreatureStorage(cid, 1337) < 4 then
		doCreatureSetStorage(cid, 1337, 4)
		doPlayerSendTextMessage(cid, 19,"Reward.")
		setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 500)
		setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 300)
	else
		doPlayerSendTextMessage(cid, 19,"You do not have enough club.")
	end
	return true
end
 
hope this works, have no idea xd
Lua:
function onSay(cid, words, param, channel)
	local str = 1337
	-- [count] = {level, heath+, mana+},
	local levels = {
		[1] = {50, 100, 50},
		[2] = {100, 200, 100},
		[3] = {150, 300, 200},
		[4] = {200, 400, 300},
	}
 
	for i = 1, #levels do
		if(getPlayerSkill(cid, SKILL_CLUB) >= levels[i][1]) then
			if(getPlayerStorageValue(cid, str) < 0) then
				setPlayerStorageValue(cid, str, 1)
				setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + levels[i][2])
				setCreatureMaxMana(cid, getCreatureMaxMana(cid) + levels[i][3])
				doPlayerSendTextMessage(cid, 19, "Reward")
				break
			else
				doPlayerSendTextMessage(cid, 19, "Sorry, you have already done this before.")
				return true
			end
		else
			doPlayerSendTextMessage(cid, 19, "Sorry, you don't have enough level.")
			return true
		end
	end
 
	return true
end

Else Synthetic's script is pretty much it, but without any loops and things.
 
Back
Top