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

Issue with 2 creaturescripts

Forum General

1st Donator Division
Joined
May 6, 2010
Messages
200
Reaction score
1
Location
Toronto, Canada
Error in server GUI;
[07/05/2010 17:26:53] [Error - CreatureScript Interface]
[07/05/2010 17:26:53] data/creaturescripts/scripts/110login.lua
[07/05/2010 17:26:53] Description:
[07/05/2010 17:26:53] (internalGetPlayerInfo) Player not found when requesting player info #3

[07/05/2010 17:26:53] [Error - CreatureScript Interface]
[07/05/2010 17:26:53] data/creaturescripts/scripts/bookmarklevel110.lua
[07/05/2010 17:26:53] Description:
[07/05/2010 17:26:53] (internalGetPlayerInfo) Player not found when requesting player info #3

Here are my scripts;

110login.lua:
Code:
local level = getPlayerLevel(cid)
local storage = getPlayerStorageValue(cid, 110)

function onLogin(cid)
	if level <= 119 and level >= 110 and storage == 1 then
		doPlayerSetLevel(cid, 110)
	return true
	end
end

bookmarklevel110.lua:
Code:
local level = getPlayerLevel(cid)

function onAdvance(cid, skill, oldLevel, newLevel)
	if level == 110 then
		doPlayerSetStorageValue(cid, 110, 1)
	end
	return true
end

creaturescripts.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
	[COLOR="Red"]<event type="login" name="Login110" event="script" value="110login.lua"/>[/COLOR]
	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
	<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>
	[COLOR="Red"]<event type="advance" name="Bookmark110" event="script" value="bookmarklevel110.lua"/>[/COLOR]
	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
</creaturescripts>

login.lua:
Code:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")

	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
[COLOR="Red"]	registerCreatureEvent(cid, "Bookmark110")
	registerCreatureEvent(cid, "Login110")[/COLOR]
	return true
end

What these scripts are supposed to do;

-When you reach level 110, you get storage value (110).
-When you log off with storage value (110) and log back on, you go back to level 110.
-When you log off without storage value (110) and log back on, you go back to level 100.

This method is call level bookmarking.


If anyone can fix these scripts or maybe redo one of your own, I'd gladly appreciate it!

Thanks,
Forum General
 
Okay, I did that and restarted the server;

Now the new problem:

[07/05/2010 17:57:22] Forum General has logged in.
[07/05/2010 17:57:22] Forum General has logged out.
[07/05/2010 17:57:35] Account Manager has logged in.
[07/05/2010 17:57:35] Account Manager has logged out.

When I try logging in, it keeps saying "Connecting to the gameworld. Please wait." So, when I press enter in my character list (to log on), it just logs him off automatically.
 
edit 110login.lua
Code:
function onLogin(cid)
	local level = getPlayerLevel(cid)
	if level < 120 and level > 109 and getPlayerStorageValue(cid, 110) == 1 then
		doPlayerSetLevel(cid, 110)
	end
	return true
end
 
Works like a charm, thanks so much again!
You've been a great help around here and I hope you continue to do so.
One day, someone's request can turn into treasure among many others.
 
Back
Top