aqubjukr
Well-Known Member
I have the following problem: When using a talkaction with param, it always returns "nil" if the player is offline.
(If the player is online everything goes well)
Example: If I type: "/player Maker" (when he is offline), it will be printed on the console: nil.
I was wondering if there is a possibility to correct this, bcos I'm breaking my head and I didn't succeed.
Script that I'm using:
(If the player is online everything goes well)
Example: If I type: "/player Maker" (when he is offline), it will be printed on the console: nil.
I was wondering if there is a possibility to correct this, bcos I'm breaking my head and I didn't succeed.
Script that I'm using:
Lua:
local player = TalkAction("/player")
function player.onSay(cid, words, param)
if not cid:getGroup():getAccess() then
return true
end
if cid:getAccountType() < ACCOUNT_TYPE_GAMEMASTER then
return false
end
logCommand(Player(cid), words, param)
if(param == "") then
cid:sendCancelMessage("Need param.")
return false
end
local player = Player(param)
if player and player:isPlayer() then
local text = "Player name: "..Creature(player):getName().."."
cid:showTextDialog(6528, text)
else
print(player)
end
return false
end
player:separator(" ")
player:register()