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

An command which uses direction.

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,855
Solutions
18
Reaction score
671
Hello.
I need an command !same-outfit between 2 players.

The Two players must stand opposite self.

Example:
player1 uses !same-outfit and he must stand to direction to player 2 (standing near player2 and looking on him), after that player1(caster) sending request to player2 and player2 receiving an information (green color on middle in the screen):
player1, is going gift you an outfit. Please write !same-outfit, to accept.

If player2 send an !same-outfit, talkaction than Player2 got outfit ID: 33.

If player2 not respond for gift (like 5 seconds), player1 receive an message:
Sorry, player2 not accept the offer.


Thanks in advance.
 
You must add here code to make it work, because I don't understand how it should work. If you want change only color it's simple, but if you set player outfit that he cannot wear after relog he can get outfit 'itemid 100'...
LUA:
function onSay(cid, words, param, channel)
	local target = getTopCreature(getPositionByDirection(getThingPosition(cid), getCreatureLookDirection(cid))
	if(isPlayer(target)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. getCreatureName(target) .. " received your request.")
		doPlayerSendTextMessage(target, MESSAGE_EVENT_ADVANCE, "Player " .. getCreatureName(cid) .. " is going to gift you an outfit. Please write !same-outfit, to accept.")
		-- here some code to make it work
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There is no player front of you.")
	end
	return true
end
 
Back
Top