[Opcode] getPlayerVocation

BananaFight
em Clients

BananaFight

Allahu Akbar
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/02/13Posts: 702Gênero: Masculino

getPlayerVocation para todas as versões com o opcode.




Instalação



Client



OtClient/Modules/gamelib/game.lua



function getPlayerVocation()
local protocol = g_game.getProtocolGame()
protocol:sendExtendedOpcode(25, 5)
end

e no seu script



ProtocolGame.registerExtendedOpcode(26,
function (protocol, opcode, buffer)
vocation = buffer
print(vocation)
end
)

Server



creaturescripts/extendedopcode.lua



function onExtendedOpcode(cid, opcode, buffer)
if opcode == 25 then
doSendPlayerExtendedOpcode(cid, 26, getPlayerVocation(cid))
end
return true
end

manoelneto

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/03/13Posts: 99

Opa Banana!

 

Voltou a ativa?

 

Isso aí, a area tava carente dos seus tópicos.

 

Rola uns tutoriais de Opcode?

 

Seria bem útil..

Abraços.

Att Manoel;

2rm9y0y.jpg

Lost Worl of the Middle Kingdom, em breve!

rohfagundes

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 10/02/11Posts: 377

coloquei do jeito q ta ai e n funcionou

n tem q colocar mais alguma coisa n?

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

/\ tens opcode no teu serv? ¬¬

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

rohfagundes

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 10/02/11Posts: 377

/\ tens opcode no teu serv? ¬¬

claro -.-

3145288

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/02/08Posts: 82

como jogar aquele vocation em uma label?

e pq aquele "5" no sendopcode?

BananaFight

Allahu Akbar
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 14/02/13Posts: 702Gênero: Masculino

O 5 no opcode é meramente ilustrativo '-'

 

Sim, tem como por em um label, Só você fazer labelName:setText(buffer) Se me lembro bem é assim.

 

Não, não voltei a ativa, só fiz pra um amigo e resolvi compartilhar com vocês.

akira021

Sky's Heart
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 10/08/08Posts: 127

ta retired banana? quem eh o moderador agora?

flug.png

 

 

itachibrrrr

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 27/04/13Posts: 6

banana teria como vc me ajuda e q tou com um poblema muito serio aqui

Waterson

Não gosto compra outro :)
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 22/06/10Posts: 89
[2/1/2014 6:13:12] [Error - CreatureScript Interface]

[2/1/2014 6:13:12] data/creaturescripts/scripts/extendedopcode.lua:onExtendedOpcode

[2/1/2014 6:13:12] Description:

[2/1/2014 6:13:12] data/creaturescripts/scripts/extendedopcode.lua:19: attempt to call global 'doSendPlayerExtendedOpcode' (a nil value)

[2/1/2014 6:13:12] stack traceback:

[2/1/2014 6:13:12] data/creaturescripts/scripts/extendedopcode.lua:19: in function <data/creaturescripts/scripts/extendedopcode.lua:14>


Eu sei que está configurado nas souces corretamente porque funciona;



if isPlayerUsingOtclient(cid) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "YOU USE OTCLIENT")

end


Aqui está o sistema inteiro:



OPCODE_LANGUAGE = 1


function onExtendedOpcode(cid, 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...

--doCreatureSetStorage(cid, CREATURE_STORAGE_LANGUAGE, buffer)

end

else

-- other opcodes can be ignored, and the server will just work fine...

end

end

function onExtendedOpcode(cid, opcode, buffer)

if isPlayerUsingOtclient(cid) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "YOU USE OTCLIENT")

end

if opcode == 25 then

doSendPlayerExtendedOpcode(cid, 26, "ALOU")

end

return true

end