ok ive been trying to work this one out (maybe ive been looking at this too long ;D) but its got the best of me now so im gonna ask away here :)
this is the function i am working with...
function OpForceMoveArrival(user, data)
if hublock == "enable" then
if user.iProfile ~= 0 then
return 1
end
end
if string.sub(data, 1, 12) == "$OpForceMove" then
-- 'here is want to get the profile of the nick that is being redirected'
if user.iProfile > RedirectedUser.iPorfile then
return 1
end
end
end
its the part in written in red i cant seem to do, i am trying to get the profile number of the nick that is being redirected ??? beats me ;D
Find the RedirectedUser's name in the data with a simple string.find pattern, and then use GetItemByName(RedirectedUser) which return with the userobject, if the user is online, else with nil. So if it's not nil, you can use then:
if user.iProfile > RedirectedUser.iProfile then
its the string.find pattern i am having problems with, i can get the profile once i can find the nick within the string
Try with it:local _,_,RedirectedUser = string.find(data,"^%$OpForceMove %$Who:(%S+)%$Where:")
yup that worked perfect, thanks :)