• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua There's anyway to make mounts not useable with some outfits?

Raiden

Developer
Joined
Sep 16, 2008
Messages
486
Reaction score
32
Location
Venezuela
Hello, that's my question, i have read a little bit and mounts just have an .xml file, nothing else, and i'm adding some custom outfits without the mount animation so when i use mounts with those outfits they look really weird, so i was thinking if there is anyway to when someone tries to put a mount using those outfit the server sends cancel and tells him that he cannot use mounts with that outfit

Thanks for any answer
 
if you edit dat file, you may add mounted looktypes, otherwise try creaturescript onExtendedOpcode, where opcode is "0xD3" (SetOutfit) or "0xD4" (ToggleMount)
experiment with return false and changing player's looktype back to unmounted
- found in protocolgame.cpp and this is where you have to parse them to make them working with client signals
 
Last edited:
Okay, let me check that, my problem is that i'm too lazy to make the mounted looktypes

Edit: well, i don't know how exactly use this ExtendedOPcodes, i'm using OTC, but i don't get it, i have the code for use it on my server, but how i know what numbers are for what functions?, i know that 0x01 is for languaje, you say to me that 0xD3 is to setoutfit, but where i see that?
 
Last edited:
protocolgame.cpp
there is function for every case
you may parse two functions, for example:
case 0xD4: parseToggleMount(msg); break;

case 0xD4: parseToggleMount(msg); parseExtendedOpcode(msg); break;
I've added print(opcode, buffer) to script to see what otclient sends(ofc it applies to all clients when you register these signals in source).
For language opcode is 1 and message while logging in or selecting language is eg. "en"
 
protocolgame.cpp
there is function for every case
you may parse two functions, for example:



I've added print(opcode, buffer) to script to see what otclient sends(ofc it applies to all clients when you register these signals in source).
For language opcode is 1 and message while logging in or selecting language is eg. "en"

Sorry for not answer, and well i understand, but everything that i need to add to sources is that line in protocolgame.cpp?, just put

Code:
case 0xD4: parseToggleMount(msg); parseExtendedOpcode(msg); break;
and then i go to creaturescripts?
 
When changing the mount check if the player has one of those outfits, if so do not accept the mount.
Same for toggle mount, if player tries to mount with such an outfit, do not allow it.
If player is changing outfit and is mounted and the new outfit is one of those outfits, then unmount the player.
 
When changing the mount check if the player has one of those outfits, if so do not accept the mount.
Same for toggle mount, if player tries to mount with such an outfit, do not allow it.
If player is changing outfit and is mounted and the new outfit is one of those outfits, then unmount the player.

Yes, but i need to add that in the extendedopcode.lua from creaturescripts or i need to add that on sources too?, final question
 
So toggleMoutn use different data type than the Opcodes?, i'm a little confused, i will try it too

SOLVED!

@tetra20 help me to make a new creatureevent to cehck when someone changes the outfit, is someone want it just replace this files:
http://speedy*****malware.localhost/NcQ7r/outfit.rar

here is an example:

Code:
function onOutfit(cid, old,current)
if isPlayer(cid) then
doCreatureSay(cid, "Outfit Changed", TALKTYPE_ORANGE_1)
end
return false
end

--[[-- look here // Sorry for mistake it is CURRENT not new
function onOutfit(cid, old,current)
if current.lookType == 349 then -- this see if the new outfitid == 349
if current.lookMount == 5 then -- this check the mount id == 5
new.lookTypeEx == 500 -- this is an itemid.every itemid has a outfit and this check the itemid
new.lookHead == 500 -- this check the colour of head
new.lookBody == 800 -- this check the body
new.lookLegs == 900 -- this check the legs
new.lookFeet == 5 -- this check the boots
new.lookAddons == 1 -- this check the addons
--]]

PD: you must be using TFS 1.0
 
Last edited:
Back
Top