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

[Mod]Help

husam

Member
Joined
Aug 23, 2008
Messages
2,216
Reaction score
11
Location
Iraq-Baghdad
Hey all, i have a mod but its not working as i wanna.. i wanna if player has lvl lower than 45 he gets 45
so this script if hes lv 44 or 40 or any lvl lower than 45 it make him lv 55 not 45 :S
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="War Level Minimum" version="1.0" author="Syntax" contact="[email protected]" enabled="yes">
        <description>
        If player loggs in and is below set level then he is reset to that level.
    </description>
        <config name="warlv_config"><![CDATA[
                config = {
                        level = 45
                }
        ]]></config>
        <event type="login" name="War Level Minimum" event="script"><![CDATA[
        function onLogin(cid)
        domodlib("warlv_config")
                if getPlayerLevel(cid) < config.level then
                        doPlayerAddExperience(cid, getExperienceForLevel(config.level))
                end
        return true
        end
]]></event>
</mod>
 
try this, you forgot to get the current exp and take that off the addexp.
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="War Level Minimum" version="1.0" author="Syntax" contact="[email protected]" enabled="yes">
        <description>
        If player loggs in and is below set level then he is reset to that level.
    </description>
        <config name="warlv_config"><![CDATA[
                config = {
                        level = 45
                }
        ]]></config>
        <event type="login" name="War Level Minimum" event="script"><![CDATA[
        function onLogin(cid)
        domodlib("warlv_config")
                if getPlayerLevel(cid) < config.level then
                        doPlayerAddExperience(cid, getExperienceForLevel(config.level)-getExperienceForLevel(getPlayerLevel(cid)))
                end
        return true
        end
]]></event>
</mod>
 
I will try it out.thanks
EDIT:
[29/08/2009 00:42:11] Loading warlevel.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/warlevel.xml
[29/08/2009 00:42:11] Line: 1, Info: XML declaration allowed only at the start of the document
 
Back
Top