• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TalkAction /mount Player, Id ~ work with TFS 0.3+, 0.4+

Alehopper

†C++|C#|Java†
Joined
Jun 25, 2011
Messages
325
Reaction score
17
Location
Poland
/mount Player, Id
work with TFS 0.3+, 0.4+

________________________________________________
  • Command:
    PHP:
    /mount Alehopper, 1
  • Screenshot:










    jF5DP.png
  • Installation:
    • PHP:
      <talkaction log="yes" words="/mount" access="5" event="script" value="mount.lua"/>

    • Code:
      function onSay(cid, words, param, channel)	if(param == '') then
      		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
      		return true
      	end
      
      
      	local t = string.explode(param, ",")
      	t[1] = tonumber(t[1])
      	if(not t[1]) then
      		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
      		return true
      	end
      
      
      	local pid = cid
      	if(t[2]) then
      		pid = getPlayerByNameWildcard(t[2])
      		if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
      			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
      			return true
      		end
      	end
      
      
      	doPlayerAddMount(pid, t[1])
      	doSendMagicEffect(getThingPosition(pid), CONST_ME_MAGIC_BLUE)
      	return true
      end
________________________________________________
  • Programmer: Alehopper
  • Tester: ​Siramix
 
Last edited:
It's great! Good work Alehopper :D
With correct code tags:

XML:
<talkaction log="yes" words="/mount" access="5" event="script" value="mount.lua"/>

Lua:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
		return true
	end

	local t = string.explode(param, ",")
	t[1] = tonumber(t[1])
	if(not t[1]) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
		return true
	end

	local pid = cid
	if(t[2]) then
		pid = getPlayerByNameWildcard(t[2])
		if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
			return true
		end
	end

	doPlayerAddMount(pid, t[1])
	doSendMagicEffect(getThingPosition(pid), CONST_ME_MAGIC_BLUE)
	return true
end
 
Last edited:
I don't know how 'doPlayerAddMount' works because i never used Mystic Spirit but, if i use /mount Darkhaos, 1200 <- This won't show an error on console? Maybe something like 'not valid mount'
 
It's backwards:
/mount number, name
 
Lolol dude ur a friggin fail, 8.6 clients got nothing to do with mounts.. It's impossible to have mounts on a 8.6 client, coz doPlayerAddMount function is only made for 8.7 and higher.. Even if the function works.. What wud u ride? An orc? The 8.6 client sprites file dun have any of the mounts on real tibia, so fail, im 100% sure it wasnt a 8.6 ot.. Stop lieing
 
hmm when i type /mount player, 2 or /mount or /mount 2, player.. nothing happens just says it in default like a chat ? did i do somethign wrong ? did i miss something that i needed to ?
 
tried it on 9.31:

15:03 Ghost [9]: /mount 1, Ghost
15:04 Ghost [9]: /mount 13, Mule
15:04 Ghost [9]: /mount Mule,13
15:05 Ghost [9]: /mount
15:06 Ghost [9]: /mount Ghost, 1200
15:06 Ghost [9]: /mount Ghost, 1
15:07 Ghost [9]: /mount 1, Ghost
15:07 Ghost [9]: /mount Ghost, 1

what are the parms?

I think it is bull crap
 
Perhaps a little fix?

tried it on 9.31:

15:03 Ghost [9]: /mount 1, Ghost
15:04 Ghost [9]: /mount 13, Mule
15:04 Ghost [9]: /mount Mule,13
15:05 Ghost [9]: /mount
15:06 Ghost [9]: /mount Ghost, 1200
15:06 Ghost [9]: /mount Ghost, 1
15:07 Ghost [9]: /mount 1, Ghost
15:07 Ghost [9]: /mount Ghost, 1

what are the parms?

I think it is bull crap

/addmount J.Dre, 1


data/talkactions/talkactions.xml
Code:
<talkaction log="yes" words="/addmount" access="5" event="script" value="mount.lua"/>

data/talkactions/scripts/mount.lua
Lua:
function onSay(cid, words, param, channel)
	local t = string.explode(param, ",")
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
		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
	
	if(not tonumber(t[2])) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
		return true
	end
 
	doPlayerAddMount(pid, t[2])
	doSendMagicEffect(getThingPosition(pid), CONST_ME_MAGIC_BLUE)
	return true
end
 
The tópic is wrong.
Not /mount Name, number, and the correct way is /mount number, Name
 
Back
Top