Resolve Right Klick Kick in Client... plz help
 

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

Resolve Right Klick Kick in Client... plz help

Started by NightLitch, 04 November, 2003, 20:45:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NightLitch

This is my Code

elseif strsub(data,1,6) == "$Kick " then
		doRightKick(curUser, data)
		return 1

function doRightKick(curUser, data)
	data=strsub(data,1,strlen(data)-1)
	s,e,whom = strfind(data,"$Kick%s+(.*)")
	if GetItemByName(whom) then
		whom=GetItemByName(whom)
		if whom.bOperator then
			return 1
		else
		local f = openfile("GR8-files/kicks.dat", "a")
		if f then
			write(f, whom.." "..whom.sIP.." "..reason.."\r\n")
			closefile(f)
		end
			whom:TempBan()
		end
	end
end


How do I get the reson to work from Client so it is being registred into my file... plz help me out...

/NightLitch
//NL

NightLitch

ptaczek someone plz help, can't be that hard but I just can't the thing to work...

want to register the reason as well as Nick & IP...

Nick & IP is no problem but reason is...

So help me....

/NIghtLitch
//NL

Tuben

#2
[20:56] 213.113.240.234:2294 > <[BBB]> [BBB] is kicking martinez because: |

elseif strsub(data,1,6) == "$Kick " then
		doRightKick(curUser, data,Reason)
		return 1
elseif (strsub(data,1,8) ==  "because:") then
 local _,_, Reason = strfind(data,is kicking%s+%S+%s+because:(.*)")
if Reason ~= nil then 
doRightKick(curUser, data,Reason)
end

function doRightKick(curUser, data,Reason)
	data=strsub(data,1,strlen(data)-1)
	s,e,whom = strfind(data,"$Kick%s+(.*)")
	if GetItemByName(whom) then
		whom=GetItemByName(whom)
		if whom.bOperator then
			return 1
		else
		local f = openfile("GR8-files/kicks.dat", "a")
		if f then
			write(f, whom.." "..whom.sIP.." "..Reason.."\r\n")
			closefile(f)
		end
			whom:TempBan()
		end
	end
end

Untested 100%

But somthing like that.
-Dark-Mind-[ DOWNLOAD ]

NightLitch

//NL

NightLitch

Was sceptic from the beginning with this solusions...

This aint working att all... becouse of double arrivals:


   elseif strsub(data,1,6) == "$Kick " then
      doRightKick(curUser, data)
      return 1
   elseif (strsub(data,1,8) ==  "because:") then
       local _,_,Reason = strfind(data,"is kicking%s+%S+%s+ because:(.*)")
      if Reason ~= nil then
         doRightKick(curUser, data,Reason)
      end
      return 1


/NightLitch
//NL

NightLitch

plz, guys help me out... How am I gonna do the:

STRFIND -line

have tried many way's but... no success....

/NightLitch
//NL

Tuben

#6
OK..

This then.

"Edit" To fast. ;)
elseif strfind(data,"You are being kicked because:") then
 local _,_, Name,Op,Reason = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$<%S+> You are being kicked because:%s+(.*)|")
  if Name~=nil and Op~=nil and Reason~=nil then
	OpCheck = GetItemByName(Op)
        if OpCheck~=nil and OpCheck.bOperator then
            User = GetItemByName(Name)
            if User~=nil then
              local f = openfile("kicks.txt","a")
              write(f,""..User.sName.." "..User.sIP.." "..Reason.."\r\n")
	      closefile(f)	
	      end          
	    end
	  end
         end
-Dark-Mind-[ DOWNLOAD ]

NightLitch

THX Tuben.... work as I wanted to now after some changes....

/NightLitch
//NL

SMF spam blocked by CleanTalk