Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended Opcodes TFS 1.3 #839

Closed
tuxico opened this issue May 1, 2017 · 2 comments
Closed

Extended Opcodes TFS 1.3 #839

tuxico opened this issue May 1, 2017 · 2 comments

Comments

@tuxico
Copy link

tuxico commented May 1, 2017

Review and dont close....

Client Files
teste.lua

function init()
ProtocolGame.registerExtendedOpcode(98, teste)
function terminate()
ProtocolGame.unregisterExtendedOpcode(98)
function refresh()
g_game.getProtocolGame():sendExtendedOpcode(98, buffer)
function teste(protocol, opcode, buffer)
print(buffer)
end

Server Files

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 == "teste" then
			player:sendExtendedOpcode(98, "teste")
		end
	end
end

Talkaction

function onSay(player, words, param)
		player:sendExtendedOpcode(player, 98, "teste")
		return print("Opcode Enviado")
end
@iryont
Copy link
Collaborator

iryont commented May 1, 2017

This is not a help section. If you want to get help then I do suggest to use otland.net for that matter.

This section is only for bugs and issues within the otclient.

@iryont iryont closed this as completed May 1, 2017
@tuxico
Copy link
Author

tuxico commented May 1, 2017

Try it in your home :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants