Hello everyone...
Thanks for reading!
Well the title says everything...
I want to make a talkaction to give X spell to a player...
Why i need it?
Because i make custom spells but i want just a few people to use it in the server, so i have to make that spell to be learned...
Please guys, can you help me with this?
Thank you!
---
Thanks Cykotitan for your talkaction, it works perfect!
Thanks for reading!
Well the title says everything...
I want to make a talkaction to give X spell to a player...
Why i need it?
Because i make custom spells but i want just a few people to use it in the server, so i have to make that spell to be learned...
Please guys, can you help me with this?
Thank you!
---
Thanks Cykotitan for your talkaction, it works perfect!
Code:
function onSay(cid, words, param, channel)
local t = string.explode(param, ",")
local target, spell = getPlayerByNameWildcard(t[1]), t[2]
return (param == '' or #t ~= 2) and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires a players name and number.") or not target and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player is not online.") or getPlayerGroupId(target) > 11 and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot give spells to another Staff member.") or getPlayerLearnedInstantSpell(target, spell) and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player already knows this spell.") or doPlayerLearnInstantSpell(target, spell) and (doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(target) .." has now learned spell " .. getInstantSpellInfo(spell)) and doSendMagicEffect(getCreaturePosition(cid), CONST_ME_SLEEP)) or doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This spell doesn't exist.")
end
Last edited: