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

CreatureEvent [MOD] Minimum level

Syntax

Developer
Joined
Oct 10, 2007
Messages
2,890
Reaction score
458
Location
Texas
Description of script is...in the script ;p
Requested by..msn contact.

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
                local exp2nl = getExperienceForLevel(config.level) - getPlayerExperience(cid) 
			doPlayerAddExperience(cid,exp2nl)
		end
	return true
	end
]]></event>
</mod>
 
Last edited:
Description of script is...in the script ;p
Requested by..msn contact.

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="buypremium_config"><![CDATA[
		config = {
			level = 45
		}
	]]></config>
	<event type="login" name="War Level Minimum" event="script"><![CDATA[
	function onLogin(cid)
		if getPlayerLevel(cid) < config.level then
			doPlayerAddExperience(cid, getExperienceForLevel(config.level))
		end
	return true
	end
]]></event>
</mod>

Bugged?

1. Buypremium config?
2. domodlib is missing.
 
[27/08/2009 23:40:54] Loading warlevel.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/warlevel.xml
[27/08/2009 23:40:54] Line: 1, Info: XML declaration allowed only at the start of the document
 
haha my bad, made it pretty fast, forgot some stuff, edit coming in a few mins
 
ah I thought getExpForLevel.. returned an integer of how much that player needed for that level, but now that I think about it...it doesn't have a cid variable so that couldn't be the case. Lol, thankyou darkhaos for clearing that up.

EDIT: updated. should work 100% now.
 
Code:
        <config name="buypremium_config"><![CDATA[
                config = {
                        level = 45
                }
        ]]></config>
For me useless when you can put numbers instead of config.level.
Second thing, for what i have to put new file in mods when i can modify orginal onLogin? :p
 
1. No offense but I didn't make the script for you so I put a config in for less...knowledgeable people.

2.Mods are meant so you don't have to modify the data directory. For easy updating. I don't care if you want to use them or not. I'm just trying to help. I'm not going to make both just cause some people don't appreciate it.
 
He is trying to encourage the usage of Mod's as it is Much better and organized then normal scripts.
 
create new .txt file and rename to "MinLV.xml" and place it in mods folder of your server. Restart TFS
 
Syntax can u make me a advanced firsitem.lua script please. i will payyyyy you. do i hear a yes?
 
Back
Top