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

Talkaction /update [solved]

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
I need a talkaction /update.

It will teleport all players online/offline to temple.
(It will not teleport players in accountid 1)
 
In talkactions.xml:
XML:
	<talkaction log="yes" words="/update" access="5" event="buffer" value="townId = 1	t = getTownTemplePosition(townId)	db.query('UPDATE `players` SET `posx` = ' .. t.x .. ', `posy` = ' .. t.y .. ', `posz` = ' .. t.z .. ' WHERE `account_id` > 1;')	for _, pid in pairs(getPlayersOnline()) do	doTeleportThing(pid, getTownTemplePosition(townId))	end"/>
That's it.
 
Last edited:
What error did it show up?

It's really the same thing... :/
LUA:
function onSay(cid, words, param, channel)
	local townId = 1
	local t = getTownTemplePosition(townId)
	db.query('UPDATE `players` SET `posx` = ' .. t.x .. ', `posy` = ' .. t.y .. ', `posz` = ' .. t.z .. ' WHERE `id` > 1;')
	for _, pid in pairs(getPlayersOnline()) do
		doTeleportThing(pid, getTownTemplePosition(townId))
	end

	return true
end
 
What error did it show up?

It's really the same thing... :/
LUA:
function onSay(cid, words, param, channel)
	local townId = 1
	local t = getTownTemplePosition(townId)
	db.query('UPDATE `players` SET `posx` = ' .. t.x .. ', `posy` = ' .. t.y .. ', `posz` = ' .. t.z .. ' WHERE `id` > 1;')
	for _, pid in pairs(getPlayersOnline()) do
		doTeleportThing(pid, getTownTemplePosition(townId))
	end

	return true
end

1. Is it teleporting only if AccountId >= 2?
 
Wait...accountId or playerId?
Code:
WHERE `id` > 1;'
^This is only sending players with playerId > 1 to the temple.
 
LUA:
function onSay(cid, words, param, channel)
	local townId = 1
	local t = getTownTemplePosition(townId)
	db.query('UPDATE `players` SET `posx` = ' .. t.x .. ', `posy` = ' .. t.y .. ', `posz` = ' .. t.z .. ' WHERE `account_id` > 1;')
	for _, pid in pairs(getPlayersOnline()) do
		doTeleportThing(pid, getTownTemplePosition(townId))
	end

	return true
end
 
That's what the query does. If any offline player logs in after executing /update he will appear on the temple.
 
Well there is /reload scripts, so it should be possible to code a /reload map. And that tps all players to temple, or kicks players then tp them. Or "gameworld is currently under maintenence" And then can update it through a command. It is possible.. Althought may crash the server is too much changes idk :P TRY IT
 
Back
Top