• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Vip Time Checker

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,984
Solutions
2
Reaction score
119
Location
Germany
GitHub
Shawak
Here a script they shows your current Vip time left.

Version:
TFS 0.3.5pl1

Credits:
100% me ^_^

Update from:
http://otland.net/f163/full-working-vip-system-shawak-44840/
You have to have the functions at your functions.lua, or the script won't work.

Script:
- mods/VipTimeCheck.xml
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="VipTime Shower" version="1.0" author="Shawak" contact="otland.net" enabled="yes">
	<description>

		This script shows your current vip time left.
		You need Shawaks Vip System, look here:
		[url]http://otland.net/f163/full-working-vip-system-shawak-44840/[/url]

	</description>
	<talkaction words="!vipcheck" event="script"><![CDATA[
	dofile(getDataDir() .. "lib/function.lua")
	function onSay(cid, words, param, channel)
		if isPlayerVip(cid) ~= TRUE then
			return doPlayerSendTextMessage(cid, 22, "You aren't a VIP Player.")
		end
		local left, d, h, m, s = (getPlayerStorageValue(cid, vip_storage) - os.time()), 0, 0, 0, 0
		while left >= 86400 do
			left = left - 86400
			d = d+1
		end
		while left >= 3600 do
			left = left - 3600
			h = h + 1
		end
		while left >= 60 do
			left = left - 60
			m = m + 1
		end
		while left >= 1 do
			left = left - 1
			s = s+1
		end
		return doPlayerPopupFYI(cid, "VIP Player Informations:\n\nYour VIP time left:\nDays: "..d.."\nHours: "..h.."\nMinutes: "..m.."\nSeconds: "..s.."")
	end
	]]></talkaction>
</mod>

Not tested!, so please report bugs on this forum ^_^.

Regards,
Shawak
 
Last edited:
Code:
dofile(getDataDir() .. "lib/function.lua")
        function onSay(cid, words, param, channel)
                if isPlayerVip(cid) ~= TRUE then
                        return doPlayerSendTextMessage(cid, 222, "You aren't a VIP Player.")
                end
                local left = getPlayerStorageValue(cid, vip_storage)
                return doPlayerPopupFYI(cid, "VIP Player Informations:\n\nYour VIP will end in: "..os.date("%d %B %Y %X ",left))
        end
better :p
 
can you make a time checker for tfs 0.2?
 
can you make it to show on web better?? cuz it already on the script /addvip~
 
Code:
os.date("%d %B %Y %X ",left)
Can you say me what it exactly does?
 
@shawak
you dont know wath is patterns? ._.
Lua.org for it ^^
e.g:
string = 'hail my name is mock and the nunber is 12 21 27 xD'
string = string.gsub(string,'%d','.')
print(string)
print:
hail my name is mock and the nunber is .. .. .. xD
^^
But in os.date %d is Day :p
print(os.date("%d %B %Y %X ",os.time()))
print it:
29 August 2009 15:35:11
 
Thanks both ^_^.

EDIT:
string = string.gsub(string,'%d','.')
This searching all numbers and change them to . ?
 
Last edited:
@shawak, yep
if you change to %s,'.' will change all letters a-z to '.'
 
ooh sorry i skipped that line you've told us that it works only with your vip system, but! can you also please edit this script which allows you to enter the door if your a vip, else i can't use it anymore :(
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if isPlayerVip(cid) == TRUE then
                if getCreaturePosition(cid).y < toPosition.y then
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
                else
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z}, TRUE)
                end
                doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
                doSendMagicEffect(getCreaturePosition(cid), 10)
        else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here! Buy VIP on the WEB.")
        end
        return TRUE
end
 
ooh sorry i skipped that line you've told us that it works only with your vip system, but! can you also please edit this script which allows you to enter the door if your a vip, else i can't use it anymore :(
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if isPlayerVip(cid) == TRUE then
                if getCreaturePosition(cid).y < toPosition.y then
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
                else
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z}, TRUE)
                end
                doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
                doSendMagicEffect(getCreaturePosition(cid), 10)
        else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here! Buy VIP on the WEB.")
        end
        return TRUE
end

This works with my vip system :thumbup:.
 
euhm.. it seems to be it was going fine.. und jetzt when i run my server i'll get an window with the following text:
Code:
[B]Mircosoft Visual C++ Runtime Library[/B]

Program: ...
File: ../luascript.h
line: 265


Expression: m_scriptEnvIndex >= 0&&M_scriptEnvIndex <21

For information on how your program can cause an assertion failure, see the Visual C++ decumentation on asserts

(Press Retry to debug the application - JIT must be enabled)


Edit: and now what to do? :huh:
it doesn't continue and run my server.
 
euhm.. it seems to be it was going fine.. und jetzt when i run my server i'll get an window with the following text:
Code:
[B]Mircosoft Visual C++ Runtime Library[/B]

Program: ...
File: ../luascript.h
line: 265


Expression: m_scriptEnvIndex >= 0&&M_scriptEnvIndex <21

For information on how your program can cause an assertion failure, see the Visual C++ decumentation on asserts

(Press Retry to debug the application - JIT must be enabled)


Edit: and now what to do? :huh:
it doesn't continue and run my server.

Try changing event="script" to evevnt="buffer".
 
yup it's working but when i use the talkaction !vipcheck nothings happends.

Edit:
console give's this:

[31/08/2009 16:34:22] Lua Script Error:
[31/08/2009 16:34:22] [string "loadBuffer"]:26: unfinished string near '")'
 
Last edited:
Back
Top