I have made a short script for sending a greeting message to specific profiles but well actually it's not working. it is my first script and it would be nice if someone could fix it cause I am stuck. thanks
AllowedProfiles = {
[0] = 1, -- Owner
[1] = 2, -- Masters
[2] = 3, -- SuperUser
[3] = 4, -- Operator
[4] = 5, -- KVIP
[5] = 0, -- VIP
[6] = 0, -- Reg
[7] = 0, -- UnReg
}
function UserConnected(user)
Core.GetUserAllData(user)
if AllowedProfiles[user.iProfile] == 1 or AllowedProfiles[user.iProfile] == 2 or AllowedProfiles[user.iProfile] == 3 or AllowedProfiles[user.iProfile] == 4 or AllowedProfiles[user.iProfile] == 5 then
if AllowedProfiles[user.iProfile] == 1 then
Core.SendToAll("---A intrat Owner-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit Owner -? " ..user.sNick.. " ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. " ?????? ???\r\n\r\n")
end
if AllowedProfiles[user.iProfile] == 2 then
Core.SendToAll("---A intrat Master-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit Master -? " ..user.sNick.. " ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. " ?????? ???\r\n\r\n")
end
if AllowedProfiles[user.iProfile] == 3 then
Core.SendToAll("---A intrat SuperUser-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit SuperUser -? " ..user.sNick.. " ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. " ?????? ???\r\n\r\n")
end
if AllowedProfiles[user.iProfile] == 4 then
Core.SendToAll("---A intrat OP-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit OP -? " ..user.sNick.. " ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. " ?????? ???\r\n\r\n")
end
if AllowedProfiles[user.iProfile] == 5 then
Core.SendToAll("---A intrat KVIP-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit KVIP -? " ..user.sNick.. " ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. " ?????? ???\r\n\r\n")
end
end
OpConnected = UserConnected
RegConnected = UserConnected
I use ptokax 0.4.1.1 and I get this error: [08:58] Syntax E:\HubSoft\0411\scripts\greet.lua:47: 'end' expected (to close 'function' at line 15) near '<eof>' (and there might be a lot more lol)
i think u forgot to end the program:P
i just added one more end
see if it works
AllowedProfiles = {
[0] = 1, -- Owner
[1] = 2, -- Masters
[2] = 3, -- SuperUser
[3] = 4, -- Operator
[4] = 5, -- KVIP
[5] = 0, -- VIP
[6] = 0, -- Reg
[7] = 0, -- UnReg
}
function UserConnected(user)
Core.GetUserAllData(user)
if AllowedProfiles[user.iProfile] == 1 or AllowedProfiles[user.iProfile] == 2 or AllowedProfiles[user.iProfile] == 3 or AllowedProfiles[user.iProfile] == 4 or AllowedProfiles[user.iProfile] == 5 then
if AllowedProfiles[user.iProfile] == 1 then
Core.SendToAll("---A intrat Owner-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit Owner -? " ..user.sNick.. " ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. " ?????? ???\r\n\r\n")
end
if AllowedProfiles[user.iProfile] == 2 then
Core.SendToAll("---A intrat Master-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit Master -? " ..user.sNick.. " ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. " ?????? ???\r\n\r\n")
end
if AllowedProfiles[user.iProfile] == 3 then
Core.SendToAll("---A intrat SuperUser-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit SuperUser -? " ..user.sNick.. " ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. " ?????? ???\r\n\r\n")
end
if AllowedProfiles[user.iProfile] == 4 then
Core.SendToAll("---A intrat OP-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit OP -? " ..user.sNick.. " ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. " ?????? ???\r\n\r\n")
end
if AllowedProfiles[user.iProfile] == 5 then
Core.SendToAll("---A intrat KVIP-ul " ..user.sNick.. ". Aveti grija---\r\n\r\n")
Core.SendToNick(user.sNick,"??? ?????? Bine ai venit KVIP -? " ..user.sNick.. " ?-. Simte-te bine pe hub.Ip-ul tau este:" ..user.sIP
.. " ?????? ???\r\n\r\n")
end
end
end
OpConnected = UserConnected
RegConnected = UserConnected
the script is working here with me see if it works for u:P
i hope i saved mutors time...
Thank you very much. I am just beggining to understand lua so I make mistakes :P
no problem buddy even m learning currently till now wasnt tat sure tat i can help in scripts but for the starters ur script was nice to do with... i hope this start takes me way ahead....