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

[Need a fix] (internalGetPlayerInfo) Player not found when requesting player info #1

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
Hello,
I'm my console is spamming an error with this script

Description:
(internalGetPlayerInfo) Player not found when requesting player info #1

Lua:
function onStepIn(cid, item, position, fromPosition)
 
if (not isPlayer(cid)) then
	return true
end

--Config-->
local starting = {x = 321, y = 829, z = 15, stackpos = 253}
local ending = {x = 337, y = 849, z = 15, stackpos = 253}
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}
local portal_in_pos = {x = 335, y = 839, z = 15, stackpos = 1}
local portal_iten_pos = getThingfromPos(portal_in_pos)
local teleportId = 1387
local player_pos_entrada = {x = 326, y = 840, z = 15}
local player_pos_saida = {x = 842, y = 839, z = 15}
local boss_pos = {x = 333, y = 837, z = 15}
local boss = "Pythius The Rotten"
local queststatus = getPlayerStorageValue(cid, 9933)
--EndConfig-->
 
--Do not touch this--
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
--Don't edit this unless you know what you are doing.
 
if item.actionid == 9022 then
	doTeleportThing(cid, player_pos_saida)
	doSendMagicEffect(player_pos_saida, 10)
	doRemoveItem(portal_iten_pos.uid, 1)
	return TRUE
end
 
if item.actionid == 9021 and queststatus == -1 then
	players = 0
	totalmonsters = 0
	monster = {}
	repeat
	creature = getThingfromPos(checking)
	if creature.itemid > 0 then
 
		if getPlayerAccess(creature.uid) == 0 then
			players = players + 1
		end
 
		if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
			totalmonsters = totalmonsters + 1
			monster[totalmonsters] = creature.uid
		end
	end
		checking.x = checking.x + 1
 
	if checking.x > ending.x then
		checking.x = starting.x
		checking.y = checking.y + 1
	end
 
	until checking.y > ending.y
 
	if players == 0 then
 
		if totalmonsters ~= 0 then
			current = 0
			repeat
			current = current + 1
			doRemoveCreature(monster[current])
			until current >= totalmonsters
		end
 
		doTeleportThing(cid, player_pos_entrada)
		doSendMagicEffect(player_pos_entrada, 10)
		doCreateMonster(boss, boss_pos)
 
		if portal_iten_pos.itemid == teleportId then
			doRemoveItem(portal_iten_pos.uid, 1)
		end
 
	else
		doMoveCreature(cid, newdir)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, '" .. getCreatureName(cid) .." is in the room now. Wait a moment!')
	end
else
	doMoveCreature(cid, newdir)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Sorry you already did this quest!')
end
end
 
Last edited:
Add
Lua:
if (not isPlayer(cid) then
		return true
	end
Below
Lua:
function onStepIn(cid, item, position, fromPosition)
 
TP to enter in Firewalker Boots Boss.

1. If get 1 player inside then another cant get in.
2. If player 1 enter and a boss is alive(someone died before) then creature is removed and a new one created
 
Lua:
local config = 
{
	storage = 10000,
	monster	= "Monster",
	topos	= {x = 0, y = 0, z = 0}
	monster	= {x = 0, y = 0, z = 0}
	area 	=
	{
		z		= 0
		from 	= {x = 0, y = 0},
		to		= {x = 0, y = 0}
	}
	
}

function onStepIn(cid, item, position, fromPosition)
	local player = {}
	for ax = config.area.from.x, config.area.to.x do
		for ay = config.area.from.y, config.area.to.y do
			playerId = getTopCreature({x = ax, y = ax, z = config.area.z})
			if (player.type ~= 1 or player.id <= 0) then
				playerId = {}
			end
		end
	end
	
	if (playerId ~= {}) then
		-- sb is inside
		-- write here msg
	else
		local storage = getStorage(config.storage)
		if (storage == -1) then
			doTeleportThing(cid, config.topos)
			doSetStorage(config.storage, doCreateMonster(config.monster, config.monster))
		else
			local monster = getThing(storage)
			if (isMonster(monster) and getCreatureName(monster) == config.monster) then
				doRemoveCreature(monster)
				doSetStorage(config.storage, -1)
			end
			doTeleportThing(cid, config.topos)
			doSetStorage(config.storage, doCreateMonster(config.monster, config.monster))
		end
	end
	
	return true
end

function onStartup()
	doSetStorage(config.storage, -1)
	return true
end
Try.
 
Do not remove monster
Lua:
	local storage		= 9935
	local monster		= "Pythius The Rotten"
	local topos		= {x = 326, y = 840, z = 15}
	local monsterpos	= {x = 333, y = 837, z = 15}
	local area 		=
	{
		z		= 15,
		from 		= {x = 321, y = 829},
		to		= {x = 337, y = 849}
	}
 
function onStepIn(cid, item, position, fromPosition)
	local player = {}
	for ax = area.from.x, area.to.x do
		for ay = area.from.y, area.to.y do
			playerId = getTopCreature({x = ax, y = ax, z = area.z})
			if (player.type ~= 1 or player.id <= 0) then
				playerId = {}
			end
		end
	end
 
	if (playerId ~= {}) then
		doTeleportThing(cid, topos)
		doCreateMonster(monster, monsterpos)
		doSetStorage(storage, 1)
	else
		local storage = getStorage(storage)
		if (storage == -1) then
			doTeleportThing(cid, topos)
			doSetStorage(storage, doCreateMonster(monster, monsterpos))
		else
			local monster = getThing(storage)
			if (isMonster(monster) and getCreatureName(monster) == monster) then
				doRemoveCreature(monster)
				doSetStorage(storage, -1)
			end
			doTeleportThing(cid, topos)
			doSetStorage(storage, doCreateMonster(monster, monster))
		end
	end
 
	return true
end
 
function onStartup()
	doSetStorage(storage, -1)
	return true
end
 
Fixed
Lua:
 local storage		= 9935
	local monster		= "Pythius The Rotten"
	local topos		= {x = 326, y = 840, z = 15}
	local monsterpos	= {x = 333, y = 837, z = 15}
	local area 		=
	{
		z		= 15,
		from 		= {x = 321, y = 829},
		to		= {x = 337, y = 849}
	}
 
function onStepIn(cid, item, position, fromPosition)
	local player = {}
	for ax = area.from.x, area.to.x do
		for ay = area.from.y, area.to.y do
			playerId = getTopCreature({x = ax, y = ax, z = area.z})
			if (player.type ~= 1 or player.id <= 0) then
				playerId = {}
			end
		end
	end
 
	if (playerId ~= {}) then
		doTeleportThing(cid, topos)
		doSetStorage(storage, doCreateMonster(monster, monsterpos))
	else
		local storage = getStorage(storage)
		if (storage == -1) then
			doTeleportThing(cid, topos)
			doSetStorage(storage, doCreateMonster(monster, monsterpos))
		else
			local monster = getThing(storage)
			if (isMonster(monster) and getCreatureName(monster) == monster) then
				doRemoveCreature(monster)
				doSetStorage(storage, -1)
			end
			doTeleportThing(cid, topos)
			doSetStorage(storage, doCreateMonster(monster, monster))
		end
	end
 
	return true
end
 
function onStartup()
	doSetStorage(storage, -1)
	return true
end
 
1. Do not removing creature
2. 2+ players can enter
Lua:
	local storage		= 9935
	local monster		= "Pythius The Rotten"
	local topos		= {x = 326, y = 840, z = 15}
	local monsterpos	= {x = 333, y = 837, z = 15}
	local area 		=
	{
		z		= 15,
		from 		= {x = 320, y = 828},
		to		= {x = 345, y = 847}
	}
 
function onStepIn(cid, item, position, fromPosition)
	local player = {}
	for ax = area.from.x, area.to.x do
		for ay = area.from.y, area.to.y do
			playerId = getTopCreature({x = ax, y = ax, z = area.z})
			if (player.type ~= 1 or player.id <= 0) then
				playerId = {}
			end
		end
	end
 
	if (playerId ~= {}) then
		doTeleportThing(cid, topos)
		doSetStorage(storage, doCreateMonster(monster, monsterpos))
	else
		local storage = getStorage(storage)
		if (storage == -1) then
			doTeleportThing(cid, topos)
			doSetStorage(storage, doCreateMonster(monster, monsterpos))
		else
			local monster = getThing(storage)
			if (isMonster(monster) and getCreatureName(monster) == monster) then
				doRemoveCreature(monster)
				doSetStorage(storage, -1)
			end
			doTeleportThing(cid, topos)
			doSetStorage(storage, doCreateMonster(monster, monster))
		end
	end
 
	return true
end
 
function onStartup()
	doSetStorage(storage, -1)
	return true
end
 
1. Do not removing creature
2. 2+ players can enter
Lua:
	local storage		= 9935
	local monster		= "Pythius The Rotten"
	local topos		= {x = 326, y = 840, z = 15}
	local monsterpos	= {x = 333, y = 837, z = 15}
	local area 		=
	{
		z		= 15,
		from 		= {x = 320, y = 828},
		to		= {x = 345, y = 847}
	}
 
function onStepIn(cid, item, position, fromPosition)
	local player = {}
	for ax = area.from.x, area.to.x do
		for ay = area.from.y, area.to.y do
			playerId = getTopCreature({x = ax, y = ax, z = area.z})
			if (player.type ~= 1 or player.id <= 0) then
				playerId = {}
			end
		end
	end
 
	if (playerId ~= {}) then
		doTeleportThing(cid, topos)
		doSetStorage(storage, doCreateMonster(monster, monsterpos))
	else
		local storage = getStorage(storage)
		if (storage == -1) then
			doTeleportThing(cid, topos)
			doSetStorage(storage, doCreateMonster(monster, monsterpos))
		else
			local monster = getThing(storage)
			if (isMonster(monster) and getCreatureName(monster) == monster) then
				doRemoveCreature(monster)
				doSetStorage(storage, -1)
			end
			doTeleportThing(cid, topos)
			doSetStorage(storage, doCreateMonster(monster, monster))
		end
	end
 
	return true
end
 
function onStartup()
	doSetStorage(storage, -1)
	return true
end
what happens when u do this script?
 
3884 and 3777

1. Do not removing creature
If player died inside then creature still alive. If new player get in do not remove creature but create another one
2. 2+ players can enter

-------------------------------------
This script works, only 1 player per time and removing creature.
But it spam an error 4x when someone stepin.
 
is
Description:
(internalGetPlayerInfo) Player not found when requesting player info #1
the full error that shows in console?


try this
Lua:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
 
if (not isPlayer(cid)) then
	return true
end
 
--Config-->
local starting = {x = 321, y = 829, z = 15, stackpos = 253}
local ending = {x = 337, y = 849, z = 15, stackpos = 253}
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}
local portal_in_pos = {x = 335, y = 839, z = 15, stackpos = 1}
local portal_iten_pos = getThingfromPos(portal_in_pos)
local teleportId = 1387
local player_pos_entrada = {x = 326, y = 840, z = 15}
local player_pos_saida = {x = 842, y = 839, z = 15}
local boss_pos = {x = 333, y = 837, z = 15}
local boss = "Pythius The Rotten"
local queststatus = getPlayerStorageValue(cid, 9933)
--EndConfig-->
 
--Do not touch this--
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
--Don't edit this unless you know what you are doing.
 
if item.actionid == 9022 then
	doTeleportThing(cid, player_pos_saida)
	doSendMagicEffect(player_pos_saida, 10)
	doRemoveItem(portal_iten_pos.uid, 1)
	return TRUE
end
 
if item.actionid == 9021 and queststatus == -1 then
	players = 0
	totalmonsters = 0
	monster = {}
	repeat
	creature = getThingfromPos(checking)
	if creature.itemid > 0 then
 
		if getPlayerAccess(creature.uid) == 0 then
			players = players + 1
		end
 
		if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
			totalmonsters = totalmonsters + 1
			monster[totalmonsters] = creature.uid
		end
	end
		checking.x = checking.x + 1
 
	if checking.x > ending.x then
		checking.x = starting.x
		checking.y = checking.y + 1
	end
 
	until checking.y > ending.y
 
	if players == 0 then
 
		if totalmonsters ~= 0 then
			current = 0
			repeat
			current = current + 1
			doRemoveCreature(monster[current])
			until current >= totalmonsters
		end
 
		doTeleportThing(cid, player_pos_entrada)
		doSendMagicEffect(player_pos_entrada, 10)
		doCreateMonster(boss, boss_pos)
 
		if portal_iten_pos.itemid == teleportId then
			doRemoveItem(portal_iten_pos.uid, 1)
		end
 
	else
		doMoveCreature(cid, newdir)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, '" .. getCreatureName(cid) .." is in the room now. Wait a moment!')
	end
else
	doMoveCreature(cid, newdir)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Sorry you already did this quest!')
end
end
 
3884 and 3777

1. Do not removing creature
If player died inside then creature still alive. If new player get in do not remove creature but create another one
2. 2+ players can enter

-------------------------------------
This script works, only 1 player per time and removing creature.
But it spam an error 4x when someone stepin.

So...only ONE player can be in the room. What should happen when more people try to join? Is the room open or is there a door or a teleport that sends the player there?
 
it should be like

else
doPlayerSendCancel(cid, "Sorry but there is someone in there! please wait.")
end
 
Back
Top