• 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!

[REQUEST] Talkactions TP/Add Outfit

armitxe

New Member
Joined
Feb 15, 2009
Messages
65
Reaction score
1
Hello everyone...

If you guys can help me.. Thank you very much!

I would like to have this 2 talkaction.

1: Teleport Back.

What's teleport back?. When we are GM's or in my case i usually summon players to where i'm to serve them.

The problem is, that in i took them from the caves or wherever they were, and now they have to go walking back...

The teleport back, is a cmd that teleport they to where they was before they got summoned... Is that possible?

2: Add Outfit Talkaction.

This one is much easier.. (i think XD) and is more like a question...

I tried to make a CMD that add's an X outfit to a player... I use it like reward of a event.. for example the Outfit of a Demon, or elf.. etc...

Here is the code i made: (Or well.. this is taked from the /newtype, i only change the "doCreatureChangeOutfit" to a "doPlayerAddOutfit".

Code:
function onSay(cid, words, param)
	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

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

	if(t[1] < 0 or t[1] == 1 or t[1] == 135 or (t[1] > 160 and t[1] < 192) or t[1] > 326) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such outfit does not exist.")
		return TRUE
	end

	local tmp = getCreatureOutfit(cid)
	tmp.lookType = t[1]
	doPlayerAddOutfit(cid, tmp, 3)
	return TRUE
end

The problem i got is just.. It dont give the outfit!, i don't know why, but the player doesn't get the outfit... I try to put the looktype in the "outfit.xml" in enable = 0 to see if it works, and i don't.

Code:
<outfit type="1" looktype="159" enabled="0" name="Elf" premium="1"/>

So, someone may please help me to fix it?, or tell me if that is possible?

These two talkactions are the ones who i would love to have...!

Thank you very much in advance for read and for help me...! xD
 
@Santy

Thank you..! again xD but it still don't working, the same problem...

Code:
23:08 <MJ> Mareheoz: /c zaraki kenpachi
23:08 /sendback zaraki kenpachi
23:08 Destination not reachable.
23:08 <MJ> Mareheoz: /sendback zaraki kenpachi
23:08 /sendback zaraki kenpachi
23:08 This player has not been summoned.

JDB, it don't works, i got this error:

Code:
[20/12/2009 23:16:43] [Warning - Event::loadScript] Can not load script (data/talkactions/scripts/daroutfit.lua)
[20/12/2009 23:16:43] data/talkactions/scripts/daroutfit.lua:6: ']' expected near ','

Thanks both for answer..

And santy, u don't know a server with a new distro but verc 8.42? :S!
 
@Santy
I give up... It don't work xD...

I'm updating to a 8.52 server... In that server the first one u post works perfect..

Thank you very much! Love u! XD

@JDB

T.T the cmd don't work... not even in the 8.52... :S thanks too for answer ^^
 
Use:

Lua:
  function onSay(cid, words, param, channel)  
        if(param ~= "")then
            local params = list({"name", "outfit", "addon"}, string.explode(param, " ", 3))
            local player = getPlayerByNameWildcard(params["name"])
            if(isPlayer(player) == true)then
                local addon = (params["outfit", "addon"])
                if (getNotationsCount(getPlayerAccount(player)) < 1) then
                    doPlayerAddOutfit(player, addons)
                    doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved a new outfit from ".. getCreatureName(cid) ..".")
                    doSendMagicEffect(getCreaturePosition(player), CONST_ME_GIFT_WRAPS)
                else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "This player has to many notations to recieve this outfit.")
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "This player is not online.")
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Command requires param.")
        end
        return true
end

Also; denada :p
 
@JDB

:S I don't know why but it don't... :S i try to use it on 3 diferent distros (8.54, 8.52, 8.42) TFS all

and always the same error:

Code:
[20/12/2009 23:16:43] [Warning - Event::loadScript] Can not load script (data/talkactions/scripts/daroutfit.lua)
[20/12/2009 23:16:43] data/talkactions/scripts/daroutfit.lua:6: ']' expected near ','

:/!

thnks 4 answer!
 
Back
Top