Skrypty & Kody Talkactions i attr

triedge

Advanced User
Zarejestrowany
Dołączył
Wrzesień 8, 2009
Posty
341
Liczba reakcji
21
Wiek
33
witam, mam problem ze skryptem Attr.lua

oto on
Kod:
local itemFuncs = 
{ 
        ["attackspeed"] = setItemAttackSpeed, 
        ["name"] = setItemName, 
        ["plural"] = setItemPluralName, 
        ["attack"] = setAttackFormula, 
        ["extraattack"] = setItemExtraAttack, 
        ["defense"] = setItemDefense, 
        ["armor"] = setItemArmor, 
        ["extradefense"] = setItemExtraDefense, 
        ["hitchance"] = setItemHitChance, 
        ["range"] = setItemShootRange, 
        ["actionid"] = doSetItemActionId, 
        ["action"] = doSetItemActionId, 
        ["aid"] = doSetItemActionId, 
        ["description"] = doSetItemSpecialDescription, 
        ["desc"] = doSetItemSpecialDescription, 
        ["protection"] = doSetItemProtection, 
        ["charges"] = doChangeTypeItem, 
        ["count"] = doChangeTypeItem 
} 
local creatureFuncs = 
{ 
        ["health"] = doCreatureAddHealth, 
        ["maxhealth"]= setCreatureMaxHealth, 
        ["mana"] = doCreatureAddMana, 
        ["maxmana"] = setCreatureMaxMana, 
        ["speed"] = doChangeSpeed, 
        ["droploot"] = doCreatureSetDropLoot, 
        ["cannotmove"] = doCreatureSetNoMove, 
        ["skull"] = doCreatureSetSkullType, 
        ["redskull"] = doPlayerSetRedSkullTicks 
} 
local playerFuncs = 
{ 
        ["fyi"] = doPlayerPopupFYI, 
        ["tutorial"] = doPlayerSendTutorial, 
        ["guildrank"] = doPlayerSetGuildRank, 
        ["guildnick"] = doPlayerSetGuildNick, 
        ["group"] = doPlayerSetGroupId, 
        ["vocation"] = doPlayerSetVocation, 
        ["promotion"] = setPlayerPromotionLevel, 
        ["stamina"] = doPlayerAddStamina, 
        ["town"] = doPlayerSetTown, 
        ["balance"] = doPlayerDepositMoney 
} 
function onSay(cid, words, param, channel) 
        if(param == "") then 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") 
                return TRUE 
        end 
        local pos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z, stackpos=1} 
        if getCreatureLookDirection(cid) == SOUTH then 
                pos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y+1, z=getCreaturePosition(cid).z, stackpos=255} 
        elseif getCreatureLookDirection(cid) == NORTH then 
                pos = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y-1, z=getCreaturePosition(cid).z, stackpos=255} 
        elseif getCreatureLookDirection(cid) == EAST then 
                pos = {x=getCreaturePosition(cid).x+1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z, stackpos=255} 
        elseif getCreatureLookDirection(cid) == WEST then 
                pos = {x=getCreaturePosition(cid).x-1, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z, stackpos=255} 
        end 
        local t = string.explode(param, ",") 
        local getThing = getThingFromPos(pos) 
        if itemFuncs[t[1]] then 
                if getThing.itemid > 0 then 
                        if itemFuncs[t[1]](getThing.uid, t[2]) then 
                                doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) 
                                return TRUE 
                        else 
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this item.") 
                                return TRUE 
                        end 
                else 
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item not found.") 
                        return TRUE 
                end 
        elseif creatureFuncs[t[1]] then 
                if isCreature(getThing.uid) then 
                        if creatureFuncs[t[1]](getThing.uid, t[2]) then 
                                doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) 
                                return TRUE 
                        else 
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this creature.") 
                                return TRUE 
                        end 
                else 
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.") 
                        return TRUE 
                end 
        elseif playerFuncs[t[1]] then 
                if isPlayer(getThing.uid) then 
                        if playerFuncs[t[1]](getThing.uid, t[2]) then 
                                doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) 
                                return TRUE 
                        else 
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this player.") 
                                return TRUE 
                        end 
                else 
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") 
                        return TRUE 
                end 
        else 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Unknow attribute.") 
                return TRUE 
        end 
        return TRUE 
end

U?ywam /attr attack, 50 i inne opcje i mi wyskakuje unkown attribute

w kt?rym pliku mog? znale?? zbi?r wszystkich tych funkcji
 
Odp: Talkactions i attr

Witam.

Sprawd? tak:

/attr attack, 50, 1

Item na ziemi? przed siebie oczywi?cie.
 
Odp: Talkactions i attr

Niestety nie dzia?a, jakie? inne pomys?y?
 
Odp: Talkactions i attr

Hmm jak b?d? na kompie to zobacz? sw?j skrypt i dam Edita.
 
Odp: Talkactions i attr

PHP:
local itemFuncs = {'attackspeed','count','charges','protection','desc','description','aid','action','actionid','range','hitchance','extradefense','armor','defense','extraattack','attack','plural','name'}
local creatureFuncs = 
{ 
        ["health"] = doCreatureAddHealth, 
        ["maxhealth"]= setCreatureMaxHealth, 
        ["mana"] = doCreatureAddMana, 
        ["maxmana"] = setCreatureMaxMana, 
        ["speed"] = doChangeSpeed, 
        ["droploot"] = doCreatureSetDropLoot, 
        ["cannotmove"] = doCreatureSetNoMove, 
        ["skull"] = doCreatureSetSkullType, 
        ["redskull"] = doPlayerSetRedSkullTicks 
} 
local playerFuncs = 
{ 
        ["fyi"] = doPlayerPopupFYI, 
        ["tutorial"] = doPlayerSendTutorial, 
        ["guildrank"] = doPlayerSetGuildRank, 
        ["guildnick"] = doPlayerSetGuildNick, 
        ["group"] = doPlayerSetGroupId, 
        ["vocation"] = doPlayerSetVocation, 
        ["promotion"] = setPlayerPromotionLevel, 
        ["stamina"] = doPlayerAddStamina, 
        ["town"] = doPlayerSetTown, 
        ["balance"] = doPlayerDepositMoney 
} 
function onSay(cid, words, param, channel) 
        if(param == "") then 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") 
                return TRUE 
        end 
        local pos = {x=getThingPos(cid).x, y=getThingPos(cid).y, z=getThingPos(cid).z, stackpos=1} 
        if getCreatureLookDirection(cid) == SOUTH then 
                pos = {x=getThingPos(cid).x, y=getThingPos(cid).y+1, z=getThingPos(cid).z, stackpos=255} 
        elseif getCreatureLookDirection(cid) == NORTH then 
                pos = {x=getThingPos(cid).x, y=getThingPos(cid).y-1, z=getThingPos(cid).z, stackpos=255} 
        elseif getCreatureLookDirection(cid) == EAST then 
                pos = {x=getThingPos(cid).x+1, y=getThingPos(cid).y, z=getThingPos(cid).z, stackpos=255} 
        elseif getCreatureLookDirection(cid) == WEST then 
                pos = {x=getThingPos(cid).x-1, y=getThingPos(cid).y, z=getThingPos(cid).z, stackpos=255} 
        end 
        local t = string.explode(param, ",") 
        local getThing = getThingFromPos(pos) 
        if isInArray(itemFuncs, t[1]) then 
                if getThing.uid > 0 then 
                        if doItemSetAttribute(getThing.uid, t[1], t[2]) then 
                                doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) 
                                return TRUE 
                        else 
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this item.") 
                                return TRUE 
                        end 
                else 
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item not found.") 
                        return TRUE 
                end 
        elseif creatureFuncs[t[1]] then 
                if isCreature(getThing.uid) then 
                        if creatureFuncs[t[1]](getThing.uid, t[2]) then 
                                doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) 
                                return TRUE 
                        else 
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this creature.") 
                                return TRUE 
                        end 
                else 
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.") 
                        return TRUE 
                end 
        elseif playerFuncs[t[1]] then 
                if isPlayer(getThing.uid) then 
                        if playerFuncs[t[1]](getThing.uid, t[2]) then 
                                doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) 
                                return TRUE 
                        else 
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this player.") 
                                return TRUE 
                        end 
                else 
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") 
                        return TRUE 
                end 
        else 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Unknow attribute.") 
                return TRUE 
        end 
        return TRUE 
end
 
Odp: Talkactions i attr

PHP:
local itemFuncs = {'attackspeed','count','charges','protection','desc','description','aid','action','actionid','range','hitchance','extradefense','armor','defense','extraattack','attack','plural','name'}
local creatureFuncs = 
{ 
        ["health"] = doCreatureAddHealth, 
        ["maxhealth"]= setCreatureMaxHealth, 
        ["mana"] = doCreatureAddMana, 
        ["maxmana"] = setCreatureMaxMana, 
        ["speed"] = doChangeSpeed, 
        ["droploot"] = doCreatureSetDropLoot, 
        ["cannotmove"] = doCreatureSetNoMove, 
        ["skull"] = doCreatureSetSkullType, 
        ["redskull"] = doPlayerSetRedSkullTicks 
} 
local playerFuncs = 
{ 
        ["fyi"] = doPlayerPopupFYI, 
        ["tutorial"] = doPlayerSendTutorial, 
        ["guildrank"] = doPlayerSetGuildRank, 
        ["guildnick"] = doPlayerSetGuildNick, 
        ["group"] = doPlayerSetGroupId, 
        ["vocation"] = doPlayerSetVocation, 
        ["promotion"] = setPlayerPromotionLevel, 
        ["stamina"] = doPlayerAddStamina, 
        ["town"] = doPlayerSetTown, 
        ["balance"] = doPlayerDepositMoney 
} 
function onSay(cid, words, param, channel) 
        if(param == "") then 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") 
                return TRUE 
        end 
        local pos = {x=getThingPos(cid).x, y=getThingPos(cid).y, z=getThingPos(cid).z, stackpos=1} 
        if getCreatureLookDirection(cid) == SOUTH then 
                pos = {x=getThingPos(cid).x, y=getThingPos(cid).y+1, z=getThingPos(cid).z, stackpos=255} 
        elseif getCreatureLookDirection(cid) == NORTH then 
                pos = {x=getThingPos(cid).x, y=getThingPos(cid).y-1, z=getThingPos(cid).z, stackpos=255} 
        elseif getCreatureLookDirection(cid) == EAST then 
                pos = {x=getThingPos(cid).x+1, y=getThingPos(cid).y, z=getThingPos(cid).z, stackpos=255} 
        elseif getCreatureLookDirection(cid) == WEST then 
                pos = {x=getThingPos(cid).x-1, y=getThingPos(cid).y, z=getThingPos(cid).z, stackpos=255} 
        end 
        local t = string.explode(param, ",") 
        local getThing = getThingFromPos(pos) 
        if isInArray(itemFuncs, t[1]) then 
                if getThing.uid > 0 then 
                        if doItemSetAttribute(getThing.uid, t[1], t[2]) then 
                                doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) 
                                return TRUE 
                        else 
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this item.") 
                                return TRUE 
                        end 
                else 
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item not found.") 
                        return TRUE 
                end 
        elseif creatureFuncs[t[1]] then 
                if isCreature(getThing.uid) then 
                        if creatureFuncs[t[1]](getThing.uid, t[2]) then 
                                doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) 
                                return TRUE 
                        else 
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this creature.") 
                                return TRUE 
                        end 
                else 
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.") 
                        return TRUE 
                end 
        elseif playerFuncs[t[1]] then 
                if isPlayer(getThing.uid) then 
                        if playerFuncs[t[1]](getThing.uid, t[2]) then 
                                doSendMagicEffect(pos, CONST_ME_MAGIC_GREEN) 
                                return TRUE 
                        else 
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can not add attribute to this player.") 
                                return TRUE 
                        end 
                else 
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") 
                        return TRUE 
                end 
        else 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Unknow attribute.") 
                return TRUE 
        end 
        return TRUE 
end
Jak zwykle Dzia?a, jak Ty co? zrobisz to dzia?? , super dzi?ki. ! Reputa niemog? da? ale podzi?kuje.
 
Odp: Talkactions i attr

Nie musisz sie martwic, dam za ciebie bo mi tez dziala
 
Back
Do góry