beenii
Well-Known Member
- Joined
- Jul 26, 2010
- Messages
- 580
- Solutions
- 1
- Reaction score
- 57
I was using this function
Animated Text - Lua - 1.3
I'm trying to tweak it to work with all clients
i edited on this part color green:
if clientid > 5 then -- if otclient send msj in color
local msg = NetworkMessage()
msg:addByte(0x84)
msg:addPosition(pos)
msg:addByte(color)
msg:addString(message)
msg:sendToPlayer(player:getId()) -- player:getid() only shown to the connected player, not for everyone
end
if clientid <= 5 then -- if client 12 send message potion
player:say(message, MESSAGE_POTION, false, nil, pos)
original function: (if 2 players are in the same area, one with an otclient and the other with an official client 12, The official customer 12, his client crashes)
Animated Text - Lua - 1.3
I'm trying to tweak it to work with all clients
Lua:
local function sendColorText(message, color, pos, send, cid)
local player = Player(cid)
if not player then
return
end
-- this could also be handled inside of the calling function instead
local clientid = player:getClient()['os']
-- if the player is using otclient
if clientid > 5 then
local msg = NetworkMessage()
msg:addByte(0x84)
msg:addPosition(pos)
msg:addByte(color)
msg:addString(message)
msg:sendToPlayer(player:getId())
end
if clientid <= 5 then
player:say(message, MESSAGE_POTION, false, nil, pos)
-- if send and next(send) then
-- for i = 1, #send do
-- if pos:getDistance(send[i]:getPosition()) <= 7 then
-- end
-- end
-- end
return true
end
end
i edited on this part color green:
if clientid > 5 then -- if otclient send msj in color
local msg = NetworkMessage()
msg:addByte(0x84)
msg:addPosition(pos)
msg:addByte(color)
msg:addString(message)
msg:sendToPlayer(player:getId()) -- player:getid() only shown to the connected player, not for everyone
end
if clientid <= 5 then -- if client 12 send message potion
player:say(message, MESSAGE_POTION, false, nil, pos)
original function: (if 2 players are in the same area, one with an otclient and the other with an official client 12, The official customer 12, his client crashes)
Lua:
local function sendColorText(message, color, pos, send, cid)
local player = Player(cid)
if not player then
return
end
-- this could also be handled inside of the calling function instead
local clientid = player:getClient()['os']
-- if the player is using otclient
if clientid > 3 then
local msg = NetworkMessage()
msg:addByte(0x84)
msg:addPosition(pos)
msg:addByte(color)
msg:addString(message)
if send and next(send) then
for i = 1, #send do
if pos:getDistance(send[i]:getPosition()) <= 7 then
msg:sendToPlayer(send[i])
end
end
end
end
end