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
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
[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.
Gonna test thx...
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
plz, guys help me out... How am I gonna do the:
STRFIND -line
have tried many way's but... no success....
/NightLitch
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
THX Tuben.... work as I wanted to now after some changes....
/NightLitch