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

Solved Movements Problem

russogracie

New Member
Joined
Sep 9, 2010
Messages
205
Reaction score
2
I need make a tag of movements.xml; to this script:

function onEquip(cid, item, slot)
local aid = item.actionid - 100
if(getPlayerGUID(cid) ~= aid)then
doPlayerSendTextMessage(cid, 19, "Hello.")
return false
else
return true
end
return true
end

Correct this?

<movevent type="onEquip" actionid="100" event="script" value="SCRIPT.lua"/>
 
Last edited:
AID won't work unless you put a value higher than 100. Because the script will substract 100 from the AID value. This will only work with items with actionid 101 or higher:
XML:
	<movevent type="Equip" actionid="101+" event="script" value="SCRIPT_NAME.lua" />

But, if you want to check every item with the itemid specified in movements.xml to check if it has a certain AID then use this:
LUA:
function onEquip(cid, item, slot)
	local actionid = item.actionid - 100
	if(getPlayerGUID(cid) ~= actionid) then
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Hello.")
		return false
	end

	return true
end
There's no need to return true or false so many times :p

In movements.xml:
XML:
	<movevent type="Equip" itemid="?" event="script" value="SCRIPT_NAME.lua" />
 
Last edited:
^ you know why aid is not the best option?

local actionid = item.actionid - 100
if(getPlayerGUID(cid) ~= actionid) then

there will be a big range of aids being used prolly
 
I need check if OnEquip the item description name its the name of player example, the item description is this:

18:35 You see a master archer's armor (Arm:15, distance fighting +3).
It can only be wielded properly by royal paladins of level 100 or higher.
It weighs 69.00 oz.
This item can only be used by the player Administer!
ItemID: [8888], ActionID: [10007].

Administer saw was the player who bought the shop and wanted only he could use it.

Have this two scripts are correct?

function onEquip(cid, item, slot)
local nomeitem = "Archer"
local iditem = 8888
local storage = 88889999
local moedanome = "Falumir Coins"
if getPlayerStorageValue(cid,storage) == 1 then
doPlayerSendCancel(cid,"Voce Tem Permissao Para Ultilizar O ".. nomeitem ..".")
else
doPlayerRemoveItem(cid,iditem,1)
local nome = getPlayerName(cid)
doPlayerSendTextMessage(cid,25,"Desculpe ".. nome .."!, Para Usar O ".. nomeitem .." Voce precisa Ter Comprado Com ".. moedanome .."!")
end
return TRUE
end

function onEquip(cid, item, slot)
local aid = item.actionid -100
if(getPlayerGUID(cid) ~= aid)then
doPlayerSendTextMessage(cid, 19, "Tu no compraste este item, no lo puedes usar.")
return false
else
return true
end
return true
end
 
actionid="101+"
Ralph_No.png
 
Damn you Ralph, I just noticed about that. Well it would work if it's for only one player...buh, forget about it... The second thing I posted should work then.
 
LUA:
function onEquip(cid, item, slot)
	local f = getItemAttribute(item.uid, 'description')
	return not f or f == getCreatureName(cid)
end
 
Cykotitan this script checks if the description of the item with the same name as yours? and if not do not let you use is it?

I think the script is already checking the item description but something is wrong because I'm the player and the description is Administer, Administer and he will not let me use.
 
Last edited:
debug
LUA:
function onEquip(cid, item, slot)
	local f = getItemAttribute(item.uid, 'description')
	if f then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, '"'..f..'" & "'..getCreatureName(cid)..'"') end
	return not f or f == getCreatureName(cid)
end
post results
 
Cykotitan it seems he is not recognizing that I have Administer name.

Look the image:

o8e0s3.png




He say this:

12:14 "This item can only be used by the player Administer!" & "Administer"

The error is not here because the description is actually named Administer!, not Administer.

I modified my shop.lua and took the "! " description but still the error persists.

12:19 "This item can only be used by the player Administer" & "Administer"
 
Last edited:
Back
Top