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

Need working premium checker

Pit2

New Member
Joined
Mar 27, 2009
Messages
71
Reaction score
0
I need script when pacc finished script tp player to temple my ots tfs 0.3.4 legolas 23 script not work error :[05/10/2009 20:00:45] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/pacc.lua)
[05/10/2009 20:00:45] data/creaturescripts/scripts/pacc.lua:12: 'end' expected (to close 'function' at line 1) near '<eof>'
 
Code:
function onLogin(cid)
		if getPlayerPremiumDays(cid) == 0 then
			doTeleportThing(cid, config.kickpos)
			doPlayerSendTextMessage(cid, 25, "Your premium time has ran out!")
			setPlayerStorageValue(cid, config.paccStorage, (getPlayerStorageValue(cid, config.paccStorage)+1))
		else
			if getPlayerStorageValue(cid, config.paccStorage) <= 0 then
				return true
		end	
		return true
	end
i pase this to pacc.lua and line to creaturescript i must have if i add this
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Pacc information" version="1.0" author="Legolas23" contact="otland.net" enabled="yes">
	<config name="PaccInformation"><![CDATA[
		config = {
			kickpos = { x=1234, y=123, z=4, stackpos=1 }
			paccStorage = 45322
			
		}
	]]></config>
	<event type="login" name="PaccInformation" event="script"><![CDATA[
		domodlib('PaccInformation')

	function onLogin(cid)
		if getPlayerPremiumDays(cid) == 0 then
			doTeleportThing(cid, config.kickpos)
			doPlayerSendTextMessage(cid, 25, "Your premium time has ran out!")
			setPlayerStorageValue(cid, config.paccStorage, (getPlayerStorageValue(cid, config.paccStorage)+1))
		else
			if getPlayerStorageValue(cid, config.paccStorage) <= 0 then
				return true
		end	
		return true
	end
	]]></event>

    <event type="login" name="PaccInformation" event="buffer"><![CDATA[
        registerCreatureEvent(cid, "PaccInformation")
        _result = true
    ]]></event>
</mod>

getPlayerPremiumDays(cid)
i have error with las line get prmium..... server saing [05/10/2009 21:51:08] Loading paccinformation.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/paccinformation.xml
[05/10/2009 21:51:09] Line: 32, Info: Extra content at the end of the document
 
It clearly says what the error is. You are missing an 'end' after lua statement, which is here:
Code:
if getPlayerStorageValue(cid, config.paccStorage) <= 0 then
    return true
After this add 'end'.

Goodbye.
 
Code:
[06/10/2009 07:38:09] data/creaturescripts/scripts/pacc.lua:4: attempt to index global 'config' (a nil value)
[06/10/2009 07:38:09] stack traceback:
[06/10/2009 07:38:09] 	data/creaturescripts/scripts/pacc.lua:4: in function <data/creaturescripts/scripts/pacc.lua:1>
[06/10/2009 07:38:09] Lolson has logged out.
[06/10/2009 07:38:10] Lolsons has logged in.

[06/10/2009 07:38:10] Lua Script Error: [CreatureScript Interface] 
[06/10/2009 07:38:10] data/creaturescripts/scripts/pacc.lua:onLogin

[06/10/2009 07:38:10] data/creaturescripts/scripts/pacc.lua:4: attempt to index global 'config' (a nil value)
[06/10/2009 07:38:10] stack traceback:
[06/10/2009 07:38:10] 	data/creaturescripts/scripts/pacc.lua:4: in function <data/creaturescripts/scripts/pacc.lua:1>
[06/10/2009 07:38:10] Lolsons has logged out.
[06/10/2009 07:38:11] Pitexx has logged in.

[06/10/2009 07:38:11] Lua Script Error: [CreatureScript Interface] 
[06/10/2009 07:38:11] data/creaturescripts/scripts/pacc.lua:onLogin

[06/10/2009 07:38:11] data/creaturescripts/scripts/pacc.lua:4: attempt to index global 'config' (a nil value)
[06/10/2009 07:38:11] stack traceback:
[06/10/2009 07:38:11] 	data/creaturescripts/scripts/pacc.lua:4: in function <data/creaturescripts/scripts/pacc.lua:1>
[06/10/2009 07:38:11] Pitexx has logged out.
i add end and this if i logging kicking to haracter list and this error
 
Try:

PHP:
local config = {
paccStorage = 688775, --not used storage
kickpos = {x=120,y=120,z=7}  --Set position temple 
}

function onLogin(cid)
		if getPlayerPremiumDays(cid) == 0 then
			doTeleportThing(cid, config.kickpos)
			doPlayerSendTextMessage(cid, 25, "Your premium time has ran out!")
			setPlayerStorageValue(cid, config.paccStorage, (getPlayerStorageValue(cid, config.paccStorage)+1))
		end	
return true
end
 
I did not check code 'how it work', but fixed on bug:
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Pacc information" version="1.0" author="Legolas23" contact="otland.net" enabled="yes">
	<config name="PaccInformation"><![CDATA[
		config = {
			kickpos = { x=1234, y=123, z=4, stackpos=1 }
			paccStorage = 45322
			
		}
	]]></config>
	<event type="login" name="PaccInformation" event="script"><![CDATA[
		domodlib('PaccInformation')

	function onLogin(cid)
		if getPlayerPremiumDays(cid) == 0 then
			doTeleportThing(cid, config.kickpos)
			doPlayerSendTextMessage(cid, 25, "Your premium time has ran out!")
			setPlayerStorageValue(cid, config.paccStorage, (getPlayerStorageValue(cid, config.paccStorage)+1))
		else
			if getPlayerStorageValue(cid, config.paccStorage) <= 0 then
				return true
			end
		end	
		return true
	end
	]]></event>

    <event type="login" name="PaccInformation" event="buffer"><![CDATA[
        registerCreatureEvent(cid, "PaccInformation")
        _result = true
    ]]></event>
</mod>
 
Back
Top