SC
pedido

Addskill

Por ScythePhantom, 04 de fev. de 2013 em Scripts

resolvido
4
2.5k
ScythePhantomS
04 de fevereiro de 2013 às 21:57

#Edit, resolvido.

Editado Dezembro 4 por ScythePhantom

joadsonJ
05 de fevereiro de 2013 às 10:18

Simples vá no seu talkaction.xml e mude sua linha que deve está mais ou menos assim

<talkaction log="yes" words="/addskill" access="5" event="function" value="ALGUMACOISA.lua"/> e coloque esse no lugar

<talkaction log="yes" words="/addskill" access="5" event="function" value="addSkill"/>, desse jeito já pega as funções da sourcer(executável)

Editado Fevereiro 5 por joadson

2 semanas depois...
murilo103M
18 de fevereiro de 2013 às 10:49

Teste esse :)

 

 

function onSay(cid, words, param, channel)

if(param == '') then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")

return true

end

local t = string.explode(param, ",")

if(not t[2]) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Not enough params.")

return true

end

local pid = getPlayerByNameWildcard(t[1])

if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")

return true

end

t[2] = t[2]:lower()

local skill = SKILL_IDS[t[2]]

if(not skill) then

local tmp = t[2]:sub(1, 1)

if(tmp == 'l' or tmp == 'e') then

skill = SKILL__LEVEL

elseif(tmp == 'm') then

skill = SKILL__MAGLEVEL

else

skill = tonumber(t[2])

if(not skill or skill < SKILL_FIRST or SKILL > SKILL__LAST) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such skill does not exists.")

return true

end

end

end

local amount = tonumber(t[3])

if(not amount or amount == 0) then

amount = 1

end

doPlayerAddSkill(pid, skill, amount, true)

return true

end

 

StigalS
22 de fevereiro de 2013 às 13:45

Tópico movido para a seção de dúvidas e pedidos resolvidos.