thokito
New Member
- Joined
- Aug 11, 2011
- Messages
- 19
- Reaction score
- 0
hello guys, how are you?
I would like to pass a movement script to action.
Explaining how the script works: you put an item in the slot and get another outfit, I would like to click on the item and get the other outfit. would?
up
up
I would like to pass a movement script to action.
Explaining how the script works: you put an item in the slot and get another outfit, I would like to click on the item and get the other outfit. would?
function onEquip(cid, item, slot, topos)
local cfg = {
[128] = 369,
[136] = 370,
[129] = 371,
[130] = 373,
[131] = 375,
[132] = 377,
[133] = 379,
[134] = 381,
[135] = 371,
[137] = 372,
[138] = 374,
[139] = 376,
[140] = 378,
[141] = 380,
[142] = 382,
[143] = 383,
[144] = 385,
[145] = 387,
[146] = 389,
[147] = 384,
[148] = 386,
[149] = 388,
[150] = 390,
[151] = 391,
[152] = 368,
[153] = 395,
[154] = 397,
[155] = 392,
[156] = 394,
[157] = 396,
[158] = 398,
[366] = 414,
[367] = 413,
[335] = 411,
[336] = 412,
[324] = 410,
[325] = 409,
[288] = 408,
[289] = 407,
[278] = 405,
[279] = 406,
[268] = 401,
[269] = 402,
[270] = 404,
[273] = 403,
[251] = 399,
[252] = 400,
}
--[[
[128] = 389
[looktype current outfit] = looktype new outfit
]]
if getTilePzInfo(getPlayerPosition(cid)) then
doPlayerSendCancel(cid,"you cannot change your outfit in a protected area.")
return TRUE
end
local p = getCreatureOutfit(cid)
local looktype = {lookType = cfg[p.lookType], lookHead = p.lookHead, lookBody = p.lookBody, lookLegs = p.lookLegs, lookFeet = p.lookFeet, lookAddons = p.lookAddons}
if cfg[p.lookType] ~= nil then doSetCreatureOutfit(cid, looktype, -1) end
return true
end
function onDeEquip(cid, item, slot)
doRemoveCondition(cid, CONDITION_OUTFIT)
return true
end
local cfg = {
[128] = 369,
[136] = 370,
[129] = 371,
[130] = 373,
[131] = 375,
[132] = 377,
[133] = 379,
[134] = 381,
[135] = 371,
[137] = 372,
[138] = 374,
[139] = 376,
[140] = 378,
[141] = 380,
[142] = 382,
[143] = 383,
[144] = 385,
[145] = 387,
[146] = 389,
[147] = 384,
[148] = 386,
[149] = 388,
[150] = 390,
[151] = 391,
[152] = 368,
[153] = 395,
[154] = 397,
[155] = 392,
[156] = 394,
[157] = 396,
[158] = 398,
[366] = 414,
[367] = 413,
[335] = 411,
[336] = 412,
[324] = 410,
[325] = 409,
[288] = 408,
[289] = 407,
[278] = 405,
[279] = 406,
[268] = 401,
[269] = 402,
[270] = 404,
[273] = 403,
[251] = 399,
[252] = 400,
}
--[[
[128] = 389
[looktype current outfit] = looktype new outfit
]]
if getTilePzInfo(getPlayerPosition(cid)) then
doPlayerSendCancel(cid,"you cannot change your outfit in a protected area.")
return TRUE
end
local p = getCreatureOutfit(cid)
local looktype = {lookType = cfg[p.lookType], lookHead = p.lookHead, lookBody = p.lookBody, lookLegs = p.lookLegs, lookFeet = p.lookFeet, lookAddons = p.lookAddons}
if cfg[p.lookType] ~= nil then doSetCreatureOutfit(cid, looktype, -1) end
return true
end
function onDeEquip(cid, item, slot)
doRemoveCondition(cid, CONDITION_OUTFIT)
return true
end
Post automatically merged:
up
Post automatically merged:
up
Last edited: