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

NPC that given premium

Sir MoX

New Member
Joined
Jan 14, 2009
Messages
285
Reaction score
1
Well if you read the tittle I need a npc that gives premium for 7 days for 14k, i someone can do it for me plz because I tried and didnt work.

Or someone can tell me the comand to get premium
 
In talkactions/scripts open buypremium.lua, erase everyhing and paste this:

PHP:
function onSay(cid, words, param)
	if getPlayerPremiumDays(cid) <= 360 then
		if doPlayerRemoveMoney(cid, 10000) == TRUE then
			doPlayerAddPremiumDays(cid, 7)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought 7 days of premium account.")
		else
			doPlayerSendCancel(cid, "You don't have enough money, 90 days premium account costs 10000 gold coins.")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		end
	else
		doPlayerSendCancel(cid, "You can not buy more than one year of Premium Account.")
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	end
	return TRUE
end

And the command is:
!buypremium
 
In talkactions/scripts open buypremium.lua, erase everyhing and paste this:

PHP:
function onSay(cid, words, param)
	if getPlayerPremiumDays(cid) <= 360 then
		if doPlayerRemoveMoney(cid, 10000) == TRUE then
			doPlayerAddPremiumDays(cid, 7)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought 7 days of premium account.")
		else
			doPlayerSendCancel(cid, "You don't have enough money, 90 days premium account costs 10000 gold coins.")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		end
	else
		doPlayerSendCancel(cid, "You can not buy more than one year of Premium Account.")
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	end
	return TRUE
end

And the command is:

Isn't even right.. He wanted 7 days for 14k not for 10k...
 
Here:

PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)				npcHandler:onCreatureAppear(cid)			end
function onCreatureDisappear(cid)			npcHandler:onCreatureDisappear(cid)			end
function onCreatureSay(cid, type, msg)			npcHandler:onCreatureSay(cid, type, msg)		end
function onThink()					npcHandler:onThink()					end

function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	
	if(msgcontains(msg, 'premium')) then
		if getPlayerPremiumDays(cid) <= 360 then
			if getPlayerMoney(cid) >= 14000 then
				selfSay('You want to buy 7 days of premium?', cid)
				talkState[talkUser] = 1
			else
				selfSay('You don\'t have enough money, 7 days premium account costs 14000 gold coin', cid)
			end
		else
			selfSay('You can not buy more than 1 year of premium!', cid)
		end
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
		if doPlayerRemoveMoney(cid, 14000) == TRUE then
			doPlayerAddPremiumDays(cid, 7)
			selfSay('Added 7 days of premium, you now have '..getPlayerPremiumDays(cid)..'.', cid)
		end
	end
return TRUE
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Rep?
 
Last edited:
In here:

2701200983250px8.png
 
Back
Top