• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Mount Problem.

puhefihi

New Member
Joined
Sep 28, 2011
Messages
84
Reaction score
0
Hey Everyone I came To my final problem. Lol. basicly what I want is a reward mount system.. So basicly people I choose to i can give a mount to. i figured i can either do this 2 ways. have an npc on gm island that trades mounts for certain items. that i can create. OR what i prefer is say something like /addmount player, 12 or something I tried to make the script this is what i tried.

my talk aciotns.xml is this


<?xml version="1.0" encoding="UTF-8"?>
<talkactions>
<!-- player talkactions -->
<talkaction words="!buypremium" script="buyprem.lua"/>
<talkaction words="!leavehouse" script="leavehouse.lua"/>
<talkaction words="!save" script="save.lua"/>
<talkaction words="!changesex" script="changesex.lua"/>
<talkaction words="!uptime" script="uptime.lua"/>
<talkaction words="!deathlist" script="deathlist.lua"/>

<!-- test talkactions -->
<talkaction words="!z" script="magiceffect.lua"/>
<talkaction words="!x" script="animationeffect.lua"/>
<talkaction log="no" words="/mount" access="5" event="script" value="mount.lua"/>
</talkactions>


my mount.lua is this

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


and my mount.xml is this

<?xml version="1.0" encoding="UTF-8"?>
<mounts>
<mount id="1" clientid="368" name="Widow Queen" speed="10" />
<mount id="2" clientid="369" name="Racing Bird" speed="20" />
<mount id="3" clientid="370" name="War Bear" speed="10" />
<mount id="4" clientid="371" name="Black Sheep" speed="10" />
<mount id="5" clientid="372" name="Midnight Panther" speed="15" />
<mount id="6" clientid="373" name="Draptor" speed="20" />
<mount id="7" clientid="374" name="Titanica" speed="15" />
<mount id="8" clientid="375" name="Tin Lizzard" speed="15" />
<mount id="9" clientid="376" name="Blazebringer" speed="20" />
<mount id="10" clientid="377" name="Rapid Boar" speed="10" />
<mount id="11" clientid="378" name="Stampor" speed="20" />
<mount id="12" clientid="379" name="Undead Cavebear" speed="20" />
</mounts>


when i try and say /mount.. or what ever it just pops up as a talk message in default.

Also just curious for later on is it possible to reward a mount to a whole guild for X amount of hours. so like guild does a quest they win X amount for X hours.
 
my mount.lua is this

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




add some doPlayerSay(cid,"...")





so do that and run the server ?
 
I would have to guess your problem is in your command declaration..

Instead of this:

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

try saying

<talkaction words="/mount" group="3" acctype="5" script="mount.lua"/>

Give that a try... It should at least pop up something different in your console...

i just tried it in my server, it seems to kinda work... I think the script might have a few issues with it. I am sorry I am not a scripter. But this should give you a good start. I would love it if you could share the script once you got it working :D this seems like an awesome script.
 
Last edited:
yeah thank you, il ltry it right now im working on an npc he seems to be in the game but i get an error in the console. can not find mount_siller .lua or somethign i dunno.. but ill try this and see if ti works thnx :D oh and def share the script with you :D.
 
hah well i changed that and when i say /mount 16:58 Command requires param. <-- happens but if i say /mount player, 1 <-- says in default.. lol gong to check the script see if i can re write it
 

Similar threads

Back
Top