player:addMount(mountId)
function onSay(cid, words, param)
local player = Player(cid)
if not player:getGroup():getAccess() then
return true
end
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
local split = param:split(",")
local target = Player(split[1])
if not target then
player:sendCancelMessage("A player with that name is not online.")
return false
end
if not split[2] then
player:sendCancelMessage("Insufficient parameters.")
return false
end
local mountId = tonumber(split[2])
if not target:hasMount(mountId) then
target:addMount(mountId)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
else
player:sendCancelMessage(string.format("%s already have this mount.", target:getName()))
end
return false
end
In which file im supposed to add this?Use
Code:player:addMount(mountId)
make this for tfs 1.3x plsUse
Code:player:addMount(mountId)
- - - Edit - - -
You could use a talkaction for that, e.g /addmount playerName, mountId
Code:function onSay(cid, words, param) local player = Player(cid) if not player:getGroup():getAccess() then return true end if player:getAccountType() < ACCOUNT_TYPE_GOD then return false end local split = param:split(",") local target = Player(split[1]) if not target then player:sendCancelMessage("A player with that name is not online.") return false end if not split[2] then player:sendCancelMessage("Insufficient parameters.") return false end local mountId = tonumber(split[2]) if not target:hasMount(mountId) then target:addMount(mountId) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) else player:sendCancelMessage(string.format("%s already have this mount.", target:getName())) end return false end
it would work the same way, other than you can remove the player variable and replace cid with player in the function argumentsmake this for tfs 1.3x pls