Hi,
I am trying to send network message to the client to update name of the summon.
Here is the code so far:
Client Error Debug:
This is the code from C++ sources I was trying to imitate. It checks whether the creature is known, if so it will not update the name, otherwise it will- so that's the code I need but something is not working and Iam completely stuck & need help
otland/forgottenserver
I am trying to send network message to the client to update name of the summon.
Here is the code so far:
Lua:
function Player.updateName(self, creatureId, creatureName)
local msg = NetworkMessage()
msg:addU32(creatureId)
msg:addString(creatureName)
msg:sendToPlayer(self)
msg:delete()
return true
end
function onCastSpell(cid, var)
local player = Player(cid)
local player_position = player:getPosition()
local monster = Game.createMonster("Training Monk", player_position)
monster:setName("New Monster Name")
monster:setMaster(player)
player:updateName(monster:getId(), monster:getName())
return true
end
Client Error Debug:
This is the code from C++ sources I was trying to imitate. It checks whether the creature is known, if so it will not update the name, otherwise it will- so that's the code I need but something is not working and Iam completely stuck & need help
otland/forgottenserver