• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Fast question

Himii

Premium User
Premium User
Joined
Jan 19, 2011
Messages
1,268
Solutions
5
Reaction score
188
Location
Sweden
Code:
doPlayerAddSkill(pid, SKILL__LEVEL, 1, true)
Shuldnt this add one level?
If not pl0x tell me what i shuld use :S
 
Code:
doPlayerAddSkill(pid, SKILL__LEVEL, 1, true)
Shuldnt this add one level?
If not pl0x tell me what i shuld use :S
what this question has about linux ? bad title :/
to add level better use [.. doPlayerAddLevel(cid, amount, round) ..]
function doPlayerAddSkill(cid, skill, amount, round)
PHP:
function doPlayerAddSkill(cid, skill, amount, round)
    local amount = amount or 1
    if(skill == SKILL__LEVEL) then
        return doPlayerAddLevel(cid, amount, round)
    elseif(skill == SKILL__MAGLEVEL) then
        return doPlayerAddMagLevel(cid, amount)
    end

    for i = 1, amount do
        doPlayerAddSkillTry(cid, skill, getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill), false)
    end

    return true
end
function doPlayerAddLevel(cid, amount, round)
PHP:
function doPlayerAddLevel(cid, amount, round)
    local experience, level, amount = 0, getPlayerLevel(cid), amount or 1
    if(amount > 0) then
        experience = getExperienceForLevel(level + amount) - (round and getPlayerExperience(cid) or getExperienceForLevel(level))
    else
        experience = -((round and getPlayerExperience(cid) or getExperienceForLevel(level)) - getExperienceForLevel(level + amount))
    end

    return doPlayerAddExperience(cid, experience)
end
 
Back
Top