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

Rewards for online record

Allesn

Member
Joined
May 4, 2011
Messages
204
Solutions
1
Reaction score
24
I wish that every time the server had a record online, all online players to gain 10k as a reward for being online.
Script to edit:

Code:
function onRecord(current, old, cid)
	db.executeQuery("INSERT INTO `server_record` (`record`, `world_id`, `timestamp`) VALUES (" .. current .. ", " .. getConfigValue('worldId') .. ", " .. os.time() .. ");")
	addEvent(doBroadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
end
 
LUA:
function onRecord(current, old, cid)
	db.executeQuery("INSERT INTO `server_record` (`record`, `world_id`, `timestamp`) VALUES (" .. current .. ", " .. getConfigValue('worldId') .. ", " .. os.time() .. ");")
	addEvent(doBroadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
	for _, cid in ipairs(getPlayersOnline()) do
	doPlayerAddMoney(cid, 10000)
	end 
end
 
LUA:
function onRecord(current, old, cid)
	db.executeQuery("INSERT INTO `server_record` (`record`, `world_id`, `timestamp`) VALUES (" .. current .. ", " .. getConfigValue('worldId') .. ", " .. os.time() .. ");")
	addEvent(doBroadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
	for _, cid in ipairs(getPlayersOnline()) do
	doPlayerAddMoney(cid, 10000)
	end 
end

And if it were an item instead of 10k?
 
And if it were an item instead of 10k?

LUA:
function onRecord(current, old, cid)
	db.executeQuery("INSERT INTO `server_record` (`record`, `world_id`, `timestamp`) VALUES (" .. current .. ", " .. getConfigValue('worldId') .. ", " .. os.time() .. ");")
	addEvent(doBroadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
	for _, cid in ipairs(getPlayersOnline()) do
	doPlayerAddItem(cid, ITEMIDGOESHERE)
	end 
end
 
LUA:
function onRecord(current, old, cid)
	db.executeQuery("INSERT INTO `server_record` (`record`, `world_id`, `timestamp`) VALUES (" .. current .. ", " .. getConfigValue('worldId') .. ", " .. os.time() .. ");")
	addEvent(doBroadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
	for _, cid in ipairs(getPlayersOnline()) do
	doPlayerAddItem(cid, ITEMIDGOESHERE)
	end 
end

where did you add this bcs i want to use it too :P
 

Similar threads

Back
Top