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

Solved OnSay InternalGetPlayerInfo Player Not found when requesting player info #11

mct

New Member
Joined
May 7, 2013
Messages
54
Reaction score
0
I'm changing the system Woe.
I need you to say "!castle" the guild system to check that the player is the same as the guild that has conquered the castle and teleport.

For example:

On player say !castle..

If playerguildid = guild.conquered.castle then
Teleport to castle.
Else
"Your guild not own the castle"

Here its my code:

Lua:
dofile("./_woe.lua")

local time=60
local storage = 1000
local res = db.getResult("SELECT `guild` FROM `woe`;")
local res1 = getPlayerGuildId(cid)

function onSay(cid, words, params)
			if isPlayer(cid) then
			if exhaustion.check(cid, storage) then      
			Woe.moveBack(cid, fromPosition, "You have to wait "..time.." for attack de castle again.")
    	end
			if res1 == res then
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Good Luck Defensor ")
					doTeleportThing(cid, {x=54, y=82, z=7})
					doSendMagicEffect(getThingPos(cid))
					exhaustion.set(cid, storage, time*60)
					else
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need conquer the castle first.")
					end		
end					
		return true
end

function onAddItem(moveitem, tileitem, position)
	doRemoveItem(moveitem.uid, moveitem.type > 0 and moveitem.type or 1)
	return true
end

The only error its " InternalGetPlayerInfo Player Not found when requesting player info #11"
 
Last edited:
If you use cid, it should always be inside a function with the parameter cid, so add this under function onSay(cid, words, params).
Lua:
local res1 = getPlayerGuildId(cid)
 
Really Thx Limos.

Now, dont have errors but the command not teleport the player.

I have guild "test" id 9. "You see yourself. You are god. You are Leader of the Test."
In sql the column guild has id 9 in table`woe`.

But directly tibia send the mesage: "BAD Luck Defensor 9!."
 
Last edited:
bump :p

- - - Updated - - -

SOLVED for me :p

Lua:
local get = res:getDataInt("guild")

and

Lua:
if (res:getDataInt("guild") == res1) then

I'm learning a lot :)

Ty Limos for posting
 
Back
Top