[SOLVED]Redirect question
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

[SOLVED]Redirect question

Started by ruler, 10 September, 2006, 19:20:58

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ruler

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

The Direct Connect Global Banlist get protected.

Thor

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

ruler

its the string.find pattern i am having problems with, i can get the profile once i can find the nick within the string

The Direct Connect Global Banlist get protected.

Thor

Try with it:
local _,_,RedirectedUser = string.find(data,"^%$OpForceMove %$Who:(%S+)%$Where:")

ruler

yup that worked perfect, thanks  :)

The Direct Connect Global Banlist get protected.

SMF spam blocked by CleanTalk