Twoje PC  
Zarejestruj się na Twoje PC
TwojePC.pl | PC | Komputery, nowe technologie, recenzje, testy
B O A R D
   » Board
 » Zadaj pytanie
 » Archiwum
 » Szukaj
 » Stylizacja

 
M E N U
  0
 » Nowości
0
 » Archiwum
0
 » Recenzje / Testy
0
 » Board
0
 » Rejestracja
0
0
 
Szukaj @ TwojePC
 

w Newsach i na Boardzie
 
OBECNI NA TPC
 
 » Liu CAs 14:10
 » Arlathan 14:08
 » ulan 14:04
 » Sherif 14:03
 » XepeR 13:59
 » ligand17 13:52
 » palioza 13:50
 » elliot_pl 13:47
 » okobar 13:32
 » piwo1 13:28
 » ham_solo 13:25
 » Mademan 13:24
 » Demo 13:16
 » DJopek 13:07
 » Guli 13:04
 » bajbusek 13:03
 » JE Jacaw 13:02
 » Artaa 13:00
 » rainy 12:49
 » Dexter 12:40

 Dzisiaj przeczytano
 45732 postów,
 wczoraj 61370

 Szybkie ładowanie
 jest:
włączone.

 
ccc
TwojePC.pl © 2001 - 2026
A R C H I W A L N A   W I A D O M O Ś Ć
    

Kosmetyczna zmiana skyrptu do kickow i banow na hubie DC. [jezyk C++]. , Mms 21/10/03 00:34
Skrypt ten jest tak napisany, ze za 3 kiki jest ban. Czy ktos moglby go poprawic tak, aby za 10 kikow byl ban? Z gory dzieki za pomoc. :)

function operatorcommands(user, data, cmd)

-----------------------------------------------------------------------------------------------------------------------------------------------
-- only [OPERATORS] and [MASTERS] can do the following commands

if user.iProfile == 0 or user.iProfile == 1 then
-----------------------------------------------------------------------------------------------------------------------------------------------

if (cmd=="!flood") then
Flood (user, data)
return 1

elseif (cmd=="!info") then
UserInfo(user, data)
return 1

elseif (cmd=="!banlog") then
Textfiles = "logs/"
ShowFile(banlog, user, sBot, "PM")
return 1

elseif (cmd=="!kicklog") then
Textfiles = "logs/"
ShowFile(kicklog, user, sBot, "PM")
return 1

elseif (cmd=="!showtimebanlog") then
Textfiles = "logs/"
ShowFile(timelog, user, sBot, "PM")
return 1

elseif (cmd=="!getwarns") then
dogetwarn(user,data)
return 1

elseif (cmd=="!getkicks") then
dogetkicks(user,data)
return 1

elseif (cmd=="!kick") then
Kick(user, data, cmd)
return 1

elseif (cmd=="!ban") then
Ban(user, data, cmd)
return 1

elseif (cmd=="!nameban") then
NameBan(user, data, cmd)
return 1

elseif (cmd=="!kill") then
Kill(user, data, cmd)
return 1

elseif (cmd=="!timeban") then
if (sYNtimeban == "1") then
DoTimeBan (user, data, cmd)
return 1
else
user:SendData(sBot, "*** Command is disabled!")
return 1
end

elseif (cmd=="!help") then
ShowOpHelp(user, data, cmd)
return 1

elseif (cmd == "!warn" ) then
warning(user, data)
return 1

elseif (cmd == "!sendhubad" ) then
AdvertFromTxt()
return 1

elseif (cmd == "!mass" ) then
_,_,cmd,message = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
if message == nil then user:SendData(sBot, "*** Enter a message!") return 1 end
Advert(message, "PM")
return 1

elseif (cmd == "!showreg" ) then
showreg(user, cmd, data)
return 1

elseif (cmd=="!hubconfig") then
ShowHubConfig(user)
return 1

elseif (cmd=="!hubstat" ) then
disphubinfo(user)
return 1

elseif (cmd=="!reguser") then
s,e,cmd,arg,arg2 = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )
if arg == nil then user:SendData(sBot, "*** You have to provide a username and password!") return 1 end
AddRegUser(arg,arg2,3)
SendToAll(sBot, "*** "..user.sName.." registered user <"..arg..">, he is now registered with us!")
victim = GetItemByName(arg)
if victim then
SendPmToNick(victim.sName, sBot, "You are now registerd at <"..sHubName..">, with the password: "..arg2)
end
return 1
end
end
end

function Ban(user, data, cmd)

local s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
local victim = GetItemByName(Name)
if victim == nil then user:SendData(sBot, "*** Enter a valid username!") return 1 end
if victim ~= nil then
if (victim.bOperator) then
user:SendData(sBot, "*** Don't Ban another operator!")
return 1 end
Textfiles = "logs/"
file = "banned.txt"
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") banned by "..user.sName.." - Reason: "..reason)
victim:SendPM(user.sName, "You are being banned Reason: "..reason)
SendToOps(sBot, user.sName.." is banning <"..Name.."> Reason: "..reason.." - IP: "..victim.sIP)
-----------------------------------------
counter["bans"] = counter["bans"] + 1
saveTableToFile(counterfile, counter)
------------------------------------------------------------
victim:Ban()
victim:Disconnect()
return 1
end
end

function NameBan(user, data, cmd)

local s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
local victim = GetItemByName(Name)
if victim == nil then user:SendData(sBot, "*** Enter a valid username!") return 1 end
if victim ~= nil then
if (victim.bOperator) then
user:SendData(sBot, "*** Don't Ban another operator!")
return 1 end
Textfiles = "logs/"
file = "banned.txt"
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") banned by "..user.sName.." - Reason: "..reason)
victim:SendPM(user.sName, "You are being banned Reason: "..reason.." ")
SendToOps(sBot, user.sName.." is banning <"..Name.."> Reason: "..reason.." - IP: "..victim.sIP)
-----------------------------------------
counter["bans"] = counter["bans"] + 1
saveTableToFile(counterfile, counter)
---------------------------------------------------------------------
victim:NickBan()
victim:Disconnect()
return 1
end
end

function Kill(user, data, cmd)

local s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
local victim = GetItemByName(Name)
if victim == nil then user:SendData(sBot, "*** Enter a valid username!") end
if victim ~= nil then
if (victim.bOperator) then
user:SendData(sBot, "*** Don't Kill another operator!")
return 1 end
Textfiles = "logs/"
file = "banned.txt"
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") killed by "..user.sName.." - Reason: "..reason)
victim:SendPM(user.sName, "You are being banned Reason: "..reason.." ")
SendToOps(sBot, user.sName.." is banning <"..Name.."> Reason: "..reason.." - IP: "..victim.sIP)
-----------------------------------------
counter["bans"] = counter["bans"] + 1
saveTableToFile(counterfile, counter)
-------------------------------------------------------------------
victim:Ban()
victim:NickBan()
victim:Disconnect()
return 1
end
end

function DoTimeBan (user, data, cmd)

local s, e, nick, hr, mn, reason = strfind(data,"%s+%S+%s+(%S+)%s+(%d+)%:(%d+)%s*(.*)")
local victim = GetItemByName(nick)
if victim == nil then
user:SendData(sBot, "*** Enter a valid username <hr:mn> <reason>")
return 1
elseif victim.bOperator then
user:SendData(sBot, "*** Don't Ban another operator!")
return 1
end
if(hr and victim) then
hr = tonumber(hr) mn = tonumber(mn)
if(hr and mn) then
Textfiles = "logs/"
file = "timeban.txt"
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") Timeban by "..user.sName.." for: "..hr.." hours : "..mn.." minutes - Reason: "..reason)
SendPmToNick(victim.sName,sBot, "You are being banned for: "..hr.." hours : "..mn.." minutes - Reason: "..reason)
victim:SendData(sBot, "You are being banned for: "..hr.." hours : "..mn.." minutes - Reason: "..reason)
SendToOps(sBot, user.sName.." is banning <"..victim.sName.."> for: "..hr.." hours : "..mn.." minutes - Reason: "..reason)
mn = mn + hr * 60
-----------------------------------------
counter["timban"] = counter["timban"] + 1
saveTableToFile(counterfile, counter)
------------------------------------------------------------
victim:TimeBan(mn)
victim:Disconnect()
end
end
end

function Kick(user, data, cmd)

s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )

if reason == nil then
rsn = "No reason given!"
s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
rsn = reason
end

victim = GetItemByName(Name)
if victim == nil then user:SendData(sBot, "*** Enter a valid username <reason>")
return 1
end

if victim == user.sName then
user:SendData(sBot, "*** Don't kick yourself!")
elseif victim.bOperator then
user:SendData(sBot, "*** Don't Kick another operator!")
else

if victim ~= nil then
----------------------------
counter["kicks"] = counter["kicks"] + 1
saveTableToFile(counterfile, counter)
------------------------------------
if kicks[victim.sName] == nil or kicks[victim.sName] == 10 then
kicks[victim.sName] = 1
else
kicks[victim.sName] = kicks[victim.sName] + 1
end

if kicks[victim.sName] == 10 then
SendPmToNick(victim.sName,sBot,"You are kicked to many times, you just got banned!")
SendToOps(sBot,"The user <"..victim.sName.."> is now banned he's kicked 10 time(s) - Reason: "..rsn)
Textfiles = "logs/"
file = "banned.txt"
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." banned by "..user.sName.." - Reason: Got kicked 10 time(s)")
-----------------------------------------
counter["bans"] = counter["bans"] + 1
saveTableToFile(counterfile, counter)
-------------------------------------------------------------------
kicks[victim.sName] = nil
dosavekick()
victim:Ban()
victim:NickBan()
victim:Disconnect()
return 1
end

if Name ~= nil then
Textfiles = "logs/"
file = "kicked.txt"
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") kicked by "..user.sName.." - Reason: "..rsn)
SendPmToNick(victim.sName,sBot,"You have been kicked "..kicks[victim.sName].." time(s) - Reason: "..rsn.." - Get 10 and you are banned!")
if kicks[victim.sName] == 10 then return 1 end
SendToOps(sBot, user.sName.." kicked user <"..victim.sName.."> "..kicks[victim.sName].." time(s) - Reason: "..rsn)
dosavekick()
victim:TempBan()
victim:Disconnect()
end
end
end
end

function Flood (user, data, reason)

s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )

if reason == nil then
rsn = "No reason given!"
s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
rsn = reason
end

victim = GetItemByName(Name)
if victim == nil then user:SendData(sBot, "*** Enter a valid username!")
return 1
end

if Name == user.sName then
user:SendData(sBot, "*** Don't flood yourself!")
elseif victim.bOperator then
user:SendData(sBot, "*** Don't flood another operator!")
else
local t = 0
repeat
victim:SendPM(sBot, "Go Away. You are not wanted here and you were flooded for the "..t.." time")
t = t+1
until t == 99

victim:SendPM(sBot, " ")
victim:SendPM(sBot, "You are flooded by Operator "..user.sName.." Reason: "..rsn)
SendToOps(sBot,"Operator "..user.sName.." Flooded <"..Name.."> user is getting pounded as we speak!")
end
end

function warning(user,data)

s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )

if reason == nil then
rsn = "No reason given!"
s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
rsn = reason
end

victim = GetItemByName(Name)
if victim == nil then user:SendData(sBot, "*** Enter a valid username!")
return 1
end

if victim == user.sName then
user:SendData(sBot, "*** Don't warn yourself!")
elseif victim.bOperator then
user:SendData(sBot, "*** Don't warn another operator!")
else

if victim ~= nil then
----------------------------
counter["warns"] = counter["warns"] + 1
saveTableToFile(counterfile, counter)
---------------------------------
if warn[victim.sName] == nil or warn[victim.sName] == 3 then
warn[victim.sName] = 1
else
warn[victim.sName] = warn[victim.sName] + 1
end

if warn[victim.sName] == 3 then
SendPmToNick(victim.sName,sBot,"This was your last warning! From Operator "..user.sName..". You are now banned!")
SendToAll(sBot,"The user <"..victim.sName.."> is now banned he's warned 3 time(s) - Reason: "..rsn)
Textfiles = "logs/"
file = "banned.txt"
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." banned by "..user.sName.." he's warned 3 Time(s) - Reason: "..rsn)
-----------------------------------------
counter["bans"] = counter["bans"] + 1
saveTableToFile(counterfile, counter)
-------------------------------------------------------------------
warn[victim.sName] = nil
dosavewarn()
victim:Ban()
victim:Disconnect()
return 1
end

if Name ~= nil then
SendPmToNick(victim.sName,sBot,"You have been warned "..warn[victim.sName].." time(s) - Reason: "..rsn.." - Get 3 and you are banned!")
if warn[victim.sName] == 3 then return 1 end
SendToAll(sBot, user.sName.." warned user <"..victim.sName.."> "..warn[victim.sName].." time(s) - Reason: "..rsn)
dosavewarn(user,data)
end
end
end
end

function showreg(user, cmd, data)

s,e,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )

if arg == "reg" then
profiless = GetUsersByProfile("Reg")
display = "Regged"
elseif arg == "vip" then
profiless = GetUsersByProfile("VIP")
display = "VIP"
elseif arg == "op" then
profiless = GetUsersByProfile("Operator")
display = "Operator"
elseif arg == "master" then
profiless = GetUsersByProfile("Master")
display = "Master"
end

if arg == nil then
local profiles = GetProfiles()
local index, profile, index2, username
local disp = ""
for index, profile in profiles do
local line = profile
disp = disp.."\r\nProfile "..line..":\r\n"
users = GetUsersByProfile(profile)
for index2, username in users do
local line = username
if GetItemByName(username) then
if (strlen(username) <= 8) then
disp = disp.." &#8226; "..line.."\t\t&#8226; On-line &#8226;\r\n"
else
disp = disp.." &#8226; "..line.."\t\t&#8226; On-line &#8226;\r\n"
end
else
if (strlen(username) <= 8) then
disp = disp.." &#8226; "..line.."\r\n"
else
disp = disp.." &#8226; "..line.."\r\n"
end
end
end
end
user:SendPM(sBot, "\r\n\r\n- &laquo; Current Regged users &raquo; -------------- &raquo; -\r\n"..disp)
return 1
end

if profiless then
local message = ""
for i=0, getn(profiless) do
if profiless[i] == nil then break
else
local lines = profiless[i]
message = message.." &#8226; "..lines.."\r\n"
end
end
user:SendPM(sBot, "\r\n\r\n- &laquo; Current Profile: "..display.." &raquo; -------------- &raquo; -\r\n\r\n"..message)
end
end

Pozdrawiam

  1. nie wiem o co chodzi ale , JanoszW 21/10/03 00:39
    if warn[victim.sName] == 3 then

    1. Dzieki, ale to nie to. , Mms 23/10/03 00:22
      :((

      Pozdrawiam

    
All rights reserved ® Copyright and Design 2001-2026, TwojePC.PL