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

Just X guild can pass ?

picachu

Member
Joined
Dec 2, 2007
Messages
970
Reaction score
11
Hello ppl!
I need one movement like PREMIUM TILE.
But, instead premium i need just X guild can pass.

Example:

I put guild id '6' in the script.
If someone of guild 6 try to pass in the tile it pass.

If someone of guild id 5 try to pass in the tile it says "Just Guild Name can pass".

please.
Ty :)
 
Code:
local function getGuildNameById(id)
	local Info = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. id .. "")
	if Info:getID() ~= LUA_ERROR then
		local Name = Info:getDataString("name")
		Info:free()
		return Name
	end
	return LUA_ERROR
end
function onStepIn(cid, item, position, fromPosition)
	if getPlayerGuildId(cid) == 6 then
		doTeleportThing(cid, position)
	else
		doPlayerSendTextMessage(cid, 20, "Only guild: " .. getGuildNameById(6) .. " can pass.")
		doTeleportThing(cid, fromPosition, false)
	end
	return true
end
 
Code:
local function getGuildNameById(id)
	local Info = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. id .. "")
	if Info:getID() ~= LUA_ERROR then
		local Name = Info:getDataString("name")
		Info:free()
		return Name
	end
	return LUA_ERROR
end
function onStepIn(cid, item, position, fromPosition)
	if getPlayerGuildId(cid) == 6 then
		doTeleportThing(cid, position)
	else
		doPlayerSendTextMessage(cid, 20, "Only guild: " .. getGuildNameById(6) .. " can pass.")
		doTeleportThing(cid, fromPosition, false)
	end
	return true
end

Code:
getGuildId(guildName)
getPlayerGuildId(cid)
 
Code:
local function getGuildNameById(id)
	local Info = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. id .. "")
	if Info:getID() ~= LUA_ERROR then
		local Name = Info:getDataString("name")
		Info:free()
		return Name
	end
	return LUA_ERROR
end
function onStepIn(cid, item, position, fromPosition)
	if getPlayerGuildId(cid) == 6 then
		doTeleportThing(cid, position)
	else
		doPlayerSendTextMessage(cid, 20, "Only guild: " .. getGuildNameById(6) .. " can pass.")
		doTeleportThing(cid, fromPosition, false)
	end
	return true
end

Thx!
rep++ for sure ;)
 
The ' x' guild use the lever , make storage and can be transported , it is possible ?
Everything is possible.
Code:
getPlayerGuildId(cid)
doPlayerSetStorageValue(uid, key, newValue)
doTeleportThing(cid, newpos[, pushmove = true])
doTransformItem(uid, toitemid[, count/subtype])
 
Everything is possible.
Code:
getPlayerGuildId(cid)
doPlayerSetStorageValue(uid, key, newValue)
doTeleportThing(cid, newpos[, pushmove = true])
doTransformItem(uid, toitemid[, count/subtype])
latest
 
Back
Top