tuxico
Member
- Joined
- Aug 2, 2010
- Messages
- 52
- Solutions
- 1
- Reaction score
- 7
Extended Opcodes are running on TFS 1.3?
Give me examples of how to use, both trying and nothing ...
Client Files
teste.lua
Server Files
Talkaction
Give me examples of how to use, both trying and nothing ...
Client Files
teste.lua
Lua:
function init()
ProtocolGame.registerExtendedOpcode(98, teste)
function terminate()
ProtocolGame.unregisterExtendedOpcode(98)
function teste(protocol, opcode, buffer)
print(buffer)
end
Server Files
Lua:
function onExtendedOpcode(player, opcode, buffer)
if opcode == OPCODE_LANGUAGE then
-- otclient language
if buffer == 'en' or buffer == 'pt' then
-- example, setting player language, because otclient is multi-language...
-- player:setStorageValue(SOME_STORAGE_ID, SOME_VALUE)
end
else
-- other opcodes can be ignored, and the server will just work fine...
end
if opcode == 98 then
if buffer == 9999 then
player:sendExtendedOpcode(98, 9999)
end
end
end
Lua:
function onSay(player, words, param)
player:sendExtendedOpcode(player, 98, 9999)
return print("Opcode Enviado")
end