PtokaX forum

Archive => Archived 5.1 boards => Help with scripts => Topic started by: Muscaria on 25 June, 2007, 15:03:25

Title: help in Leviathan
Post by: Muscaria on 25 June, 2007, 15:03:25

hello all =]

if someone knows how to make the registration of an user to be sent in opchat please let me know
and pls send me what file or code need to post it so u can tell me what to edit


thanx
:)
Title: Re: help in Leviathan
Post by: Cêñoßy†ê on 25 June, 2007, 15:39:41
if you want script to send message to op-chant when user has registered himself,open Script_Commands.lua with notepad and search for Command["regme"] = function(user, data, where)

then replace that whole function with this


Command["regme"] = function(user, data, where)
local _,_,_,passw = string.find( data, "%b<>%s+(%S+)%s+(%S+)" )
if GetUserProfile(user.sName) == nil then
if passw then
if CheckName(user.sName) == nil then
if CheckPassword(passw) == nil then
SendToOpChat(Cfg.Bot_Name.."> "..user.sName.." used self-registration and is now registered in hub "..frmHub:GetHubName())
user:SendPM(Cfg.Bot_Name,"\n\r\n\tYou are succesfully registered !\r\tProfile: Reg\r\tNick: "..user.sName.."\r\tPassword: "..passw.."\r\tHub address: "..frmHub:GetHubAddress()..":"..frmHub:GetHubPort().."")
UserInfo[string.lower(user.sName)] = {Registered_By = user.sName,Time_Registered = os.date("%A %d %B %Y / %X"),Users_Registered = 0, Julian = os.time(os.date("!*t")),Enter = os.date(), SessionTime = 0, TotalTime = 0, Leave = os.date(),Messages = { MAIN = 0, PM = 0},Tag = user.sTag,IP = user.sIP,dns = (WSA.GetHostByAddr(user.sIP) or "")}
SaveToFile(UserInfoFile,UserInfo, "UserInfo")
AddRegUser(user.sName,passw,3)
else
user:SendMessage(Cfg.Bot_Name,CheckPassword(passw))
end
else
user:SendMessage(Cfg.Bot_Name,CheckName(victim))
end
else
user:SendMessage(Cfg.Bot_Name, "Right command is !regme <password> !!!")
end
else
user:SendMessage(Cfg.Bot_Name, "Dont even try it!!! We DONT have room for 2 same registered nicks here!!")
end
return 1
end


or if you want that users registration request comes to OP-Chat then replace it with this


Command["regme"] = function(user, data, where)
local _,_,_,passw = string.find( data, "%b<>%s+(%S+)%s+(%S+)" )
if GetUserProfile(user.sName) == nil then
if passw then
SendToOpChat(Cfg.Bot_Name.."> "..user.sName.." wants to get registered with password "..passw.." in hub "..frmHub:GetHubName())
user:SendMessage(Cfg.Bot_Name, "Your registration request sended to OP-Chat, please wait till some operator will register you !")
else
user:SendMessage(Cfg.Bot_Name, "Right command is !regme <password> !!!")
end
else
user:SendMessage(Cfg.Bot_Name, "Dont even try it!!! We DONT have room for 2 same registered nicks here!!")
end
return 1
end
Title: Re: help in Leviathan
Post by: Muscaria on 06 July, 2007, 17:36:18
 
hello bro,
just to tell that the user dont reg by him self only the ops can reg and they can reg vip,svip,op,superop,master,administrator and owner...prob i need to edit all those reging just dont know how :)

:) i figure it ot bro thanx a lot
cheers
ok i need your help again friends :)
i get the eror when i try to change the profile of a user....this is the eror

Script error found, please notify C??o?y?? or T?M??r?V?ll?R with this message:
Leviathan v3.0
...syMexico/scripts/LV_DataBase/lua/Script_Commands.lua:435: attempt to call global 'ChangeRegUser' (a nil value)

and here is the part of the code...

Command["changeprofile"] = function(user, data)
if user.iProfile == 6 or Command_Permission["changeprofile"][user.iProfile] == 1 then
local s,e,cmd,victim,prof = string.find(data, "%b<>%s+(%S+)%s+(%S+)%s+(%S+)")
if victim then
if frmHub:isNickRegged(victim) then
if Cvrt.P1[string.lower(prof)] then
if GetUserProfile(victim) == Cvrt.P1[string.lower(prof)] then
user:SendData(Cfg.Bot_Name,"Seams user: "..victim.." is allready registered as: "..string.upper(prof).." !!!")
return 1
end
if ProtectionTable[user.iProfile][Cvrt.P1[string.lower(prof)]] == 0 then
user:SendData(Cfg.Bot_Name,"You silly mortal... you cant upgrade to ["..prof.."] with that profile!!!")
else
SendToAll(Cfg.Bot_Name,victim.."'s profile changed to: "..string.upper(prof).." by: "..Cvrt.P2[user.iProfile].." "..user.sName)
ChangeRegUser(victim,frmHub:GetUserPassword(victim),Cvrt.P1[string.lower(prof)])
local who = GetItemByName(victim)
if who then
who:SendPM(Cfg.Bot_Name,"Your profile is changed to "..string.upper(prof).."  by: "..Cvrt.P2[user.iProfile].." "..user.sName)
else
user:SendPM(Cfg.Bot_Name,who.."'s profile is changed to "..string.upper(prof).."  with password: "..frmHub:GetUserPassword(who))
end
end
else
user:SendData(Cfg.Bot_Name, "*** You used a unknown profile! (profiles: owner, netfounder, moderator, master, operator, vip, reg)")
end
else
user:SendData(Cfg.Bot_Name,"Cant change profile from: "..victim.." because that nick aint registered!!")
end
else
user:SendData(Cfg.Bot_Name, "Right command is !changeprofile <nick> <owner/netfounder/moderator/master/operator/vip/reg> !!!")
end
else
Forbidden(user)
end
return 1
end