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

Concatenate...

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
Code:
function getPlayerPowerSkill(cid)
 if isPlayer(cid) == TRUE then
  local SKILL_POWER = 449933
   local skill = getPlayerStorageValue(cid, SKILL_POWER)
  end
 return skill
end

function doPlayerAddPowerSkill(cid, level)
 if isPlayer(cid) == TRUE then
  local SKILL_POWER = 449933
   local skill = getPlayerStorageValue(cid, SKILL_POWER)
    skill = skill + level
   setPlayerStorageValue(cid, SKILL_POWER, skill)
  end
 return TRUE
end

Error on IMG:
erroxqe.jpg

Help-me please:
Code:
function onSay(cid, words, param, channel)
 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have "..getPlayerPowerSkill(cid).." points of power skill.")
 return TRUE
end
 
Code:
function getPlayerPowerSkill(cid)

	local SKILL_POWER = nil
	local skill = nil

	if isPlayer(cid) == TRUE then
		SKILL_POWER = 449933
		skill = getPlayerStorageValue(cid, SKILL_POWER)
	end

	if (skill ~= nil) then
		return skill
	else
		return 0
	end

end
 
i think local are declared outside function & why you have 2x locals :p

Lua:
local SKILL_POWER = 449933
local skill = getPlayerStorageValue(cid, SKILL_POWER)

function getPlayerPowerSkill(cid)
 if isPlayer(cid) == TRUE then
  end
 return skill
end

function doPlayerAddPowerSkill(cid, level)
 if isPlayer(cid) == TRUE then
    skill = skill + level
   setPlayerStorageValue(cid, SKILL_POWER, skill)
  end
 return TRUE
end
 
Back
Top