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

CreatureEvent Idea for PvP-Enforced Servers for donations [Idea]

narko

vertrauenswürdig ~
Joined
Oct 19, 2008
Messages
1,317
Solutions
2
Reaction score
131
Location
Unknown
Hello, i present a new script:



Example:


Rick buy a $5 dollars pack <<< for 50 levels per login for (1month) << Used this system if have a reset level for a die or login.

Script:

data/creaturescripts/login.lua

open login.lua and after
Code:
	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

Add:

Code:
if getPlayerStorageValue(cid, 5689) then
doPlayerAddLevel(cid, 50)
doCreatureSay(cid, "Im recieve 50 levels because im donator.", TALKTYPE_ORANGE_1)
end


How to addStorage << with a time function:

data/talkactions/scripts/
create addstorage.lua

Lua:
function onSay(cid, words, param)
	if(param == "") then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return TRUE
	end

	local t = string.explode(param, ",")

	if(not isPlayer(t[1])) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with that name is not online.")
		return TRUE
	end
	
	local storage = tonumber(t[2])
	local days = tonumber(t[3])
	if(not storage or days) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong input.")
		return TRUE
	end
	
	setAccountStorageValue(getAccountIdByName(t[1]), t[2], os.time() + (t[3] * 24 * 3600))
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Storage Value #"..t[2].." of player "..t[1].." has been set to "..t[3]..".")
	return TRUE
end

How to use:

/setstorage player, 5689, 30

this config is for a one month..

Comment!!

if you have a other code please post.
 
And also you missed the talkactions.xml implement, maybe you should remove that script of the main post and just put /storage player, storage, value command.
 
the function includes storage with time remebember:

/setstorage player, 5689, 30 << time 30 days = month = 1 donation
 
Back
Top