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

requesting give premium talkaction ???

Frillinde

Founder: Another Realm
Joined
Jan 16, 2012
Messages
148
Reaction score
3
Location
his computer
im looking for a talkaction to give players accounts premium days or take away premium days...should be able to use any char name on an account to give a variable amount of premium time to the whole account

example /giveprem bob 10 (bobs whole account gets 10 days of premium time)
example 2 /takeprem bob 10 (bobs whole account loses 10 days of premium time)

also is there a mod or something for doing a free premium event?like anyone online during a set time (for example,....like friday 6pm thru sunday10pm) would get X days of premium or even a set weekend for free premium each month?

thanks for any help with this
 
1) /addprem Playername
XML:
<talkaction log="yes" words="/addprem " access="5" event="script" value="addpremium.lua"/>
Code:
function onSay(cid, words, param)
doPlayerAddPremiumDays(cid, 10)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "GOD Have Added To You 10 Premium Days.")
return
end
2)/takeprem Playername
XML:
<talkaction log="yes" words="/takeprem " access="5" event="script" value="takepremium.lua"/>
Code:
function onSay(cid, words, param)
doPlayerRemovePremiumDays(cid, 10)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "GOD Have Removed 10 Premium Days From You.")
return
end
 
not tested, should work though

to addpremium days
LUA:
function onSay(cid, words, param, channel)
	if(param == '') then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
	end
	local t = string.explode(param, " ")
	local pid = getPlayerByNameWildcard(t[1])
	if(not pid) then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " ..t[1].. " not found.")
	end

	if(getPlayerAccess(pid) >= getPlayerAccess(cid)) then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action.")
	end
	
	if(not t[2]) then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Enter a valid number of days to add.")
	end
	
	if isPremium(pid) then
		doPlayerAddPremiumDays(pid, t[2])
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You added "..t[1].." "..t[2].." days of premium.")
		doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been granted "..t[2].." days of premium.")
	else
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player "..t[1].." has no premium account.")
	end
	return true
end
to remove premium days
LUA:
function onSay(cid, words, param, channel)
	if(param == '') then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
	end
	local t = string.explode(param, " ")
	local pid = getPlayerByNameWildcard(t[1])
	if(not pid) then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " ..t[1].. " not found.")
	end

	if(getPlayerAccess(pid) >= getPlayerAccess(cid)) then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action.")
	end
	
	if(not t[2]) then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Enter a valid number of days to take away.")
	end
	
	if isPremium(pid) then
		doPlayerRemovePremiumDays(pid, t[2])
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You decreased "..t[1].." "..t[2].." days of premium.")
		doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "You lost "..t[2].." days of premium.")
	else
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player "..t[1].." has no premium account.")
	end
	return true
end



@Bolrin Mage
use [.lua] [./lua] tags (without the -> . )

LUA:
function onSay(cid, words, param)
        doPlayerAddPremiumDays(cid, 10)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "GOD Have Added To You 10 Premium Days.")
return true --missed return true in both scripts
end
 
Last edited:
premium script
LUA:
function onSay(cid,words,param)
if doPlayerRemoveItem(cid, 2160, 1) then
		doPlayerAddPremiumDays(cid, 100)
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are now premium!")
					doSendMagicEffect(getPlayerPosition(cid),53)
						doCreatureSay(cid,"Awesome Im Premium!", 3)
		else
			doPlayerSendCancel(cid,"You don\'t have enough money")
end
return true
end

remove premium script
LUA:
function onSay(cid,words,param)
doPlayerRemovePremiumDays(cid, 10)
doCreatureSay(cid,"Oh man :(, I lost my premium", 3)
end
return true
end

edit:
@down, srry just saw lots of premium scripts so I felt like posting mine.
 
Last edited:
example /giveprem bob 10 (bobs whole account gets 10 days of premium time)
example 2 /takeprem bob 10 (bobs whole account loses 10 days of premium time)

read the request :>

Edit: No problem xD
 
Last edited:
It can be done in a single script:

premium.lua:
LUA:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local t = string.explode(param, ",")
	if(not tonumber(t[2])) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action.")
		return true
	end

	local pid = getPlayerByNameWildcard(t[1])
	if(not pid) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")
		return true
	end

	local name, subId, action = "added", t[2], "to"
	if(words:sub(2, 2) == "t") then
		name, subId, action = "taken", -t[2], "from"
	end

	doPlayerAddPremiumDays(pid, subId)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have " .. name .. " " .. subId .. " premium days " .. action .. " " .. getCreatureName(pid) .. ".")
	doPlayerSendTextMessage(pid, MESSAGE_EVENT_ADVANCE, "" .. getCreatureName(cid) .. " has " .. name .. " " .. subId .. " premium days " .. action .. " you.")
	return true
end

In talkactions.xml:
XML:
	<talkaction log="yes" words="/giveprem;/takeprem" access="5" event="script" value="premium.lua"/>
 
Thanks guys the talkaction thing is working, so how about that free premium weekend thing?.....Any ideas?It would only last from Friday evening to a Sunday evening and give all free accounts premium only during that time.
Thanks again :)
 
nono....not for a week
.....just a weekend (6pm friday,march 5 untill 10pm sunday, march 7........... for example) but set to do 1 weekend a month (or 12x a year) automatically.Hope this helps
:)
 
FINALY HERE YOU ARE :D
1) go to globalevents\scripts and make file AUTOPREMIUM.lua
LUA:
function onThink(interval, param)
local players = getPlayersOnline()
	for _, cid in ipairs(getPlayersOnline()) do
		doPlayerAddPremiumDays(cid, 1)
		doBroadcastMessage('IT IS THE WEEKEND HAPPY PREMIUM DAY')
        end
     return TRUE
end
2) go to globalevents.xml add this change "????" to time in seconds like if u want each 7 days it will be "604800"
XML:
<globalevent name="AUTOPREMIUM" interval="????" event="script" value="AUTOPREMIUM.lua"/>
 
Last edited:
Back
Top