• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Talkaction (Guild Members)

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
Hello,
today I had an Idea, I don't know how to do it alone so I'm requesting this script:

- Only guild leaders can use
- Guild leaders will be able to use only if globalstorage == 1230
- When guild leader use this command all guild members will receive the storage.
Members of Guild 1 will receive storage 1000.
Members of Guild 2 will receive storage 2000.
Members of Guild 3 will receive storage 3000.
[...]


PS.: Players who joined guild after leader used this will not receive storage.

EDIT:
Talkaction
When leader 'join' then online members (including leader) will receive storage (unique storage to his guild)
LUA:
function onSay(cid, words, param, channel)
	local guild = getPlayerGuildId(cid)
	if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER or getStorage(1230) == -1) then
		doPlayerSendChannelMessage(cid, "", "You can\'t join. Possible reasons:\n1. You aren\'t leader of guild.\n2. This event didn\'t started yet.", TALKTYPE_CHANNEL_W, 0)
		return true
	end
	for _, player in ipairs(getPlayersOnline())
		if getPlayerGuildId(player) == guild then
			setPlayerStorageValue(player, 1000*guild, 1)
		end
	end
end

Teleport
each guild will get teleported to a diferent place
LUA:
local tps = {
{x=1, y=2, z=7},
{x=1, y=2, z=7},
{x=1, y=2, z=7}}
function onStepIn(cid, item, position, fromPosition) 
    if getPlayerGuildId(cid) then
        doTeleportThing(cid, tps[getPlayerGuildId(cid)])
    end
end

Creatureevents
I need a onLogIn script that when player login he will receive unique storage of his guild (Only if his leader has joined)
 
Last edited:
LUA:
function onSay(cid, words, param, channel)
	local guild = getPlayerGuildId(cid)
	if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER or getStorage(1230) == -1) then
		doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0)
		return true
	end
	for _, player in ipairs(getPlayersOnline())
		if getPlayerGuildId(player) == guild then
			setPlayerStorageValue(player, 1000*guild, 1)
		end
	end
end
 
Listen,
I have a teleport that will work like this:
Each guild get teleported to diferent place.

How can I do that? ._.
 
Last edited:
LUA:
local tps = {
{x=1, y=2, z=7},
{x=1, y=2, z=7},
{x=1, y=2, z=7}}
function onStepIn(cid, item, position, fromPosition) 
    if getPlayerGuildId(cid) then
        doTeleportThing(cid, tps[getPlayerGuildId(cid)])
    end
end
 
You are so faster, lol!


Question:

Will this talkaction add storage to members offline?
LUA:
function onSay(cid, words, param, channel)
	local guild = getPlayerGuildId(cid)
	if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER or getStorage(1230) == -1) then
		doPlayerSendChannelMessage(cid, "", "You can\'t join. Possible reasons:\n1. You aren\'t leader of guild.\n2. This event didn\'t started yet.", TALKTYPE_CHANNEL_W, 0)
		return true
	end
	for _, player in ipairs(getPlayersOnline())
		if getPlayerGuildId(player) == guild then
			setPlayerStorageValue(player, 1000*guild, 1)
		end
	end
end
 
Will it work?
LUA:
function onSay(cid, words, param, channel)
	local guild = getPlayerGuildId(cid)
	if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER or getStorage(1230) == -1) then
		doPlayerSendChannelMessage(cid, "", "You can\'t join. Possible reasons:\n1. You aren\'t leader of guild.\n2. This event didn\'t started yet.", TALKTYPE_CHANNEL_W, 0)
		return true
	end
	for _, player in ipairs(getPlayersOnline())
		if getPlayerGuildId(player) == guild then
			storageguildp =  1000*guild
                        db.executeQuery("UPDATE `player_storage` SET `value` = 1 WHERE `key` = ".. storageguildp .."")
		end
	end
end
 
You need to run that query.
It's complicated u will need to change that evrytime player join/leave guild.
Better do on login if guild leader storage == 1 and player storage == -1 then set player storage 1.
I won't do it for u.
You need to learn something yourselfes.
 
I just don't know how can I do this:
- if get leader storage == 1
LUA:
function onLogin(cid)

local guild = getPlayerGuildId(cid)

	if getGlobalStorageValue(1230) == -1 and guild then
		setPlayerStorageValue(player, 1000*guild, 1)
	end
return true
end
 
LUA:
local guild = getPlayerGuildId(cid)
if not guild then
    return true
end
local owner = db.getResult("SELECT `ownerid` FROM `guilds` WHERE `id` = "..guild..";")
if getCreatureByName(getPlayerNameByGUID(owner)) then
	owner = getCreatureByName(getPlayerNameByGUID(owner))
	if getPlayerStorage(owner, 1240) == 1 then
		setPlayerStorage(cid, 1240, 1)
	end
else
	local tmp = db.getResult("SELECT `value` FROM `player_storage` WHERE `key` = 1240")
	if tmp:getID() ~= -1 and tmp:getDataInt("value") == 1 then
		setPlayerStorage(cid, 1240, 1)
	end
end
it isn't the best way imho...
 
Hello,
today I had an Idea, I don't know how to do it alone so I'm requesting this script:

- Only guild leaders can use
- Guild leaders will be able to use only if globalstorage == 1230
- When guild leader use this command all guild members will receive the storage.
Members of Guild 1 will receive storage 1000.
Members of Guild 2 will receive storage 2000.
Members of Guild 3 will receive storage 3000.
[...]


PS.: Players who joined guild after leader used this will not receive storage.

EDIT:
Talkaction
When leader 'join' then online members (including leader) will receive storage (unique storage to his guild)
LUA:
function onSay(cid, words, param, channel)
	local guild = getPlayerGuildId(cid)
	if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER or getStorage(1230) == -1) then
		doPlayerSendChannelMessage(cid, "", "You can\'t join. Possible reasons:\n1. You aren\'t leader of guild.\n2. This event didn\'t started yet.", TALKTYPE_CHANNEL_W, 0)
		return true
	end
	for _, player in ipairs(getPlayersOnline())
		if getPlayerGuildId(player) == guild then
			setPlayerStorageValue(player, 1000*guild, 1)
		end
	end
end

Teleport
each guild will get teleported to a diferent place
LUA:
local tps = {
{x=1, y=2, z=7},
{x=1, y=2, z=7},
{x=1, y=2, z=7}}
function onStepIn(cid, item, position, fromPosition) 
    if getPlayerGuildId(cid) then
        doTeleportThing(cid, tps[getPlayerGuildId(cid)])
    end
end

Creatureevents
I need a onLogIn script that when player login he will receive unique storage of his guild (Only if his leader has joined)
 
Back
Top