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

[Rev: 793] isPlayerGhost(cid) always is in ghost

drosah

New Member
Joined
Aug 16, 2007
Messages
69
Reaction score
0
if u use the function isPlayerGhost(cid) says that you aways invisible :)

example use this script ^^:

PHP:
function setPlayerGhost(cid, val)
	if val == 0 then
		if isPlayerGhost(cid) then
			doPlayerSendCancel(cid,"invisible val = 1")
			executeCommand(cid, "/ghost", "")
		else
			doPlayerSendCancel(cid,"visible1")
		end
	else
		if not isPlayerGhost(cid) then
			doPlayerSendCancel(cid,"visible0")
			executeCommand(cid, "/ghost", "")
		else
			doPlayerSendCancel(cid,"invisible val = 0")	
		end
	end
end

PS.: Ignore executecommand (but doesn't has at the forggoten ^^. It's a function that execute a command without access restriction)

set this function at any script like a talk action etc... and test it ^^

of course has an console erro with exhaustion function :P
[17/05/2008 14:30:22] Lua Script Error: [TalkAction Interface]
[17/05/2008 14:30:22] in a timer event called from:
[17/05/2008 14:30:22] data/talkactions/scripts/spells/invisible.lua:onSay

[17/05/2008 14:30:22] attempt to index a nil value

UPDATE:

well, I guess it should be:

if isPlayerGhost(cid) == TRUE/FALSE (1/0) then

of course the function is it now and work prefect:

PHP:
function setPlayerGhost(cid, val)
    if isPlayerGhost(cid) ~= val then
            executeCommand(cid, "/ghost", "")
    end
end
 
Last edited:
I get this error:
Warning: [Event::loadScript] Event onSay not found. data/talkactions/scripts/invi.lua
 
well, I guess it should be:

if isPlayerGhost(cid) == TRUE/FALSE (1/0) then
 
Back
Top